Skip to content

Add Mesa as a workspace filesystem provider#18627

Open
warrenbhw wants to merge 5 commits into
mastra-ai:mainfrom
mesa-dot-dev:warrenbhw/mesa-filesystem-integration
Open

Add Mesa as a workspace filesystem provider#18627
warrenbhw wants to merge 5 commits into
mastra-ai:mainfrom
mesa-dot-dev:warrenbhw/mesa-filesystem-integration

Conversation

@warrenbhw

@warrenbhw warrenbhw commented Jun 29, 2026

Copy link
Copy Markdown

Description

Adds a new @mastra/mesa workspace filesystem provider backed by Mesa repos. The provider mounts repos through the Mesa SDK, implements the Mastra workspace filesystem interface, and exposes Mesa-specific helpers like bash(), change, bookmark, and the mounted filesystem for advanced use.

Also adds docs, README usage, focused unit/integration test coverage, a changeset, and the lockfile/package workspace updates needed for @mesadev/sdk@0.38.0.

TODO: need to work with Mastra core team to add Mesa credentials to secrets manager so integration tests will run in CI

Validated with:

  • corepack pnpm --filter ./workspaces/mesa test:unit
  • corepack pnpm --filter ./workspaces/mesa build
  • corepack pnpm --filter ./workspaces/mesa lint
  • corepack pnpm --filter ./docs build

Related issue(s)

#18629

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test update

Checklist

  • I have linked the related issue(s) in the description above
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works
  • I have addressed all Coderabbit comments on this PR

ELI5

This adds a new way for Mastra workspaces to use Mesa as their file storage. In simple terms, it lets Mastra read and manage files inside Mesa repositories, and it also adds docs, tests, and package setup so people can use it safely.

What changed

  • Added a new @mastra/mesa workspace package with a Mesa-backed MesaFilesystem provider.
  • Implemented workspace file operations by mounting Mesa repos through the Mesa SDK.
  • Exposed Mesa-specific helpers like bash(), change, bookmark, and the mounted filesystem.
  • Added provider config/schema support, including required repo config and read-only handling.
  • Added unit and integration tests covering filesystem behavior, provider setup, and Mesa-specific APIs.
  • Added README and docs pages with usage examples and path semantics guidance.
  • Added changeset, changelog, and workspace/build/lint config updates.
  • Updated workspace trust policy for @mesadev/sdk@0.38.0.

Notable refinements

  • Preserves errors from exists checks instead of treating them as missing files.
  • Requires repos in the provider schema.

@changeset-bot

changeset-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cd81649

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@mastra/mesa Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

@warrenbhw is attempting to deploy a commit to the Mastra Team on Vercel.

A member of the Team first needs to authorize it.

@dane-ai-mastra dane-ai-mastra Bot added the needs-issue PR is missing a linked issue label Jun 29, 2026
@github-actions github-actions Bot added the Documentation Improvements or additions to documentation label Jun 29, 2026
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Introduces the @mastra/mesa package, a new Mesa-backed workspace filesystem provider. Adds MesaFilesystem class and mesaFilesystemProvider descriptor, full unit and integration test coverage, reference documentation, a changeset entry, and package scaffolding including build, lint, and TypeScript configs.

Changes

Mesa Filesystem Provider

Layer / File(s) Summary
Package scaffolding and build config
workspaces/mesa/package.json, workspaces/mesa/tsconfig*.json, workspaces/mesa/tsup.config.ts, workspaces/mesa/vitest.config.ts, workspaces/mesa/eslint.config.js, workspaces/mesa/lint-staged.config.js, workspaces/mesa/CHANGELOG.md, workspaces/mesa/README.md, pnpm-workspace.yaml
New package manifest with ESM/CJS exports, scripts, peer dep on @mastra/core, build config via tsup with type generation, Vitest config, lint tooling, README, initial changelog, and @mesadev/sdk@0.38.0 added to trustPolicyExclude.
MesaFilesystem core implementation
workspaces/mesa/src/filesystem/index.ts
Implements MesaFilesystemOptions interface and MesaFilesystem class: path normalization, Mesa SDK mount lifecycle, init(), read-only enforcement, all filesystem operations (read/write/append/delete/copy/move/mkdir/rmdir/readdir/stat/realpath/exists), error classification/mapping to Mastra error types, recursive directory traversal, and Mesa-specific bash/change/bookmark accessors.
Provider descriptor and public entrypoint
workspaces/mesa/src/provider.ts, workspaces/mesa/src/index.ts
Exports mesaFilesystemProvider with provider metadata, configSchema (required repos, optional apiKey/org/readOnly/cache/ttl), and a createFilesystem factory. Re-exports MesaFilesystem, MesaFilesystemOptions, and mesaFilesystemProvider as the package public API.
Unit tests
workspaces/mesa/src/filesystem/index.test.ts, workspaces/mesa/src/provider.test.ts
Mocked test suite covering constructor metadata, lifecycle/mount behavior, all file and directory operations with error edge cases, read-only rejection, Mesa-specific surface, and provider descriptor schema/factory assertions.
Integration tests
workspaces/mesa/src/filesystem/index.integration.test.ts
Environment-gated tests creating a real Mesa repo, implementing RootedMesaFilesystem for path-confined conformance testing, smoke-testing basic file operations, and wiring the conformance suite.
Documentation and changeset
docs/src/content/en/reference/workspace/mesa-filesystem.mdx, docs/src/content/en/docs/workspace/filesystem.mdx, .changeset/few-planets-invite.md
Adds the full MesaFilesystem reference page (installation, usage, path semantics, read-only, versioning), updates the filesystem overview provider list and related links, and adds the minor changeset entry.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

Suggested labels

tests: green ✅, complexity: critical

Suggested reviewers

  • abhiaiyer91
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise, descriptive, and accurately summarizes the new Mesa workspace filesystem provider.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dane-ai-mastra

Copy link
Copy Markdown
Contributor

PR triage

This PR needs to fix an existing issue. Please link an issue in the PR description, for example with Fixes #1234 or Closes #1234.

Applied label: needs-issue

PRs without a linked issue will automatically close after 1 day(s) with the label.


Changed test gate

Changed Test Gate is pending. The Changed Test Gate / changed-tests check will update the test label when it completes.

Comment thread pnpm-workspace.yaml
@superagent-security superagent-security Bot added the pr:flagged Superagent security flag label Jun 29, 2026
@socket-security

socket-security Bot commented Jun 29, 2026

Copy link
Copy Markdown

Dependency limit exceeded — report not shown.

This pull request scan exceeded the 10,000-dependency limit applied to this scan, so the results are incomplete and may be inaccurate. To avoid reporting false positives, Socket has not posted a report.

Upgrade your plan to raise the dependency limit and get complete reports, or view the partial scan in the dashboard.

Socket is always free for open source. If this is a non-commercial open source project, contact us to request a free Team account.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@workspaces/mesa/README.md`:
- Around line 7-9: The install example in the README is incomplete because the
example usage imports from `@mastra/core` while the package only peers on it, so
update the install step shown in the README to include `@mastra/core` alongside
`@mastra/mesa`. Make sure the documentation near the initial setup example clearly
reflects the dependency requirement so users can copy the install command and
run the sample imports without missing-module errors.

In `@workspaces/mesa/src/filesystem/index.integration.test.ts`:
- Around line 207-210: The toMesaPath helper currently uses path.join on
normalized input, which allows path traversal to escape this.root for values
like ../sibling or /../sibling. Update toMesaPath to enforce sandbox containment
by resolving the candidate path against this.root, verifying the result stays
within the rooted test directory, and rejecting any escaped path before
returning it. Use the existing toMesaPath method in the filesystem test adapter
to centralize this validation so all read/write/delete operations remain
isolated.
- Around line 23-25: The module-level MESA_API_KEY guard in the integration test
file is aborting Vitest collection instead of skipping these tests. Move the
check out of top-level execution and gate the suite or individual tests in the
existing MesaFilesystem integration test setup so they register as skipped when
MESA_API_KEY is missing, using the test suite entrypoints in
index.integration.test.ts rather than throwing during import.

In `@workspaces/mesa/src/filesystem/index.ts`:
- Around line 63-67: normalizePath currently calls path.normalize before the
path is rooted, so relative inputs with .. can keep a leading parent segment.
Update normalizePath to anchor the input to "/" first and then normalize the
rooted value, preserving the existing handling for empty and "." inputs. This
change should be made in normalizePath so every caller gets a correctly
collapsed absolute path for parent-directory checks and write paths.
- Around line 447-453: The exists() helper in MesaFileSystem is swallowing every
failure and returning false, which makes non-missing errors look like “path
absent.” Update exists(inputPath) to only return false for genuine not-found
cases from this.filesystem.exists(normalizePath(inputPath)), and rethrow
auth/network/SDK or other unexpected errors so the overwrite: false preflight
used by the write/copy/move call sites remains reliable.

In `@workspaces/mesa/src/provider.ts`:
- Around line 15-21: The Mesa provider schema currently allows an empty repos
array even though MesaFilesystem.init() rejects it at runtime; update the schema
in provider.ts so the repos property enforces at least one entry. Use the
existing repos property definition in the schema (and the MesaFilesystem.init()
contract) to locate the change, and add the appropriate array constraint so
invalid empty configs fail validation instead of initialization.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 78b53b0b-7996-42ea-8184-06ce7f691721

📥 Commits

Reviewing files that changed from the base of the PR and between 56ea17e and b25f445.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (20)
  • .changeset/few-planets-invite.md
  • MESA_INTEGRATION_PLAN.md
  • docs/src/content/en/docs/workspace/filesystem.mdx
  • docs/src/content/en/reference/workspace/mesa-filesystem.mdx
  • pnpm-workspace.yaml
  • workspaces/mesa/CHANGELOG.md
  • workspaces/mesa/README.md
  • workspaces/mesa/eslint.config.js
  • workspaces/mesa/lint-staged.config.js
  • workspaces/mesa/package.json
  • workspaces/mesa/src/filesystem/index.integration.test.ts
  • workspaces/mesa/src/filesystem/index.test.ts
  • workspaces/mesa/src/filesystem/index.ts
  • workspaces/mesa/src/index.ts
  • workspaces/mesa/src/provider.test.ts
  • workspaces/mesa/src/provider.ts
  • workspaces/mesa/tsconfig.build.json
  • workspaces/mesa/tsconfig.json
  • workspaces/mesa/tsup.config.ts
  • workspaces/mesa/vitest.config.ts

Comment thread workspaces/mesa/README.md
Comment on lines +23 to +25
if (!process.env.MESA_API_KEY) {
throw new Error('MesaFilesystem integration tests require MESA_API_KEY.');
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Skip these integration tests when MESA_API_KEY is missing.

Throwing at module load makes the entire Vitest run fail on machines or CI where the secret is intentionally absent. The PR summary describes these as environment-gated tests, so this should register skipped tests instead of aborting collection.

Suggested fix
-import { afterAll, describe, expect, it } from 'vitest';
+import { afterAll, describe, expect, it } from 'vitest';
 ...
-if (!process.env.MESA_API_KEY) {
-  throw new Error('MesaFilesystem integration tests require MESA_API_KEY.');
-}
+const hasMesaApiKey = Boolean(process.env.MESA_API_KEY);
+const describeMesa = hasMesaApiKey ? describe : describe.skip;
 ...
-describe('MesaFilesystem integration', () => {
+describeMesa('MesaFilesystem integration', () => {
   ...
 });
 
-createFilesystemTestSuite({
-  suiteName: 'MesaFilesystem Conformance',
-  createFilesystem: async () => {
-    const testRoot = await mesaRepoPath(`conformance-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`);
-    return new RootedMesaFilesystem(await createMesaFilesystem(), testRoot);
-  },
-  cleanupFilesystem: async fs => {
-    await fs.rmdir('/', { recursive: true, force: true }).catch(() => {});
-  },
-  capabilities: {
-    supportsAppend: true,
-    supportsBinaryFiles: true,
-    supportsMounting: false,
-    supportsForceDelete: true,
-    supportsOverwrite: true,
-    supportsConcurrency: true,
-    supportsEmptyDirectories: true,
-    deleteThrowsOnMissing: true,
-  },
-  testTimeout: 30000,
-});
+if (hasMesaApiKey) {
+  createFilesystemTestSuite({
+    suiteName: 'MesaFilesystem Conformance',
+    createFilesystem: async () => {
+      const testRoot = await mesaRepoPath(`conformance-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`);
+      return new RootedMesaFilesystem(await createMesaFilesystem(), testRoot);
+    },
+    cleanupFilesystem: async fs => {
+      await fs.rmdir('/', { recursive: true, force: true }).catch(() => {});
+    },
+    capabilities: {
+      supportsAppend: true,
+      supportsBinaryFiles: true,
+      supportsMounting: false,
+      supportsForceDelete: true,
+      supportsOverwrite: true,
+      supportsConcurrency: true,
+      supportsEmptyDirectories: true,
+      deleteThrowsOnMissing: true,
+    },
+    testTimeout: 30000,
+  });
+}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (!process.env.MESA_API_KEY) {
throw new Error('MesaFilesystem integration tests require MESA_API_KEY.');
}
const hasMesaApiKey = Boolean(process.env.MESA_API_KEY);
const describeMesa = hasMesaApiKey ? describe : describe.skip;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@workspaces/mesa/src/filesystem/index.integration.test.ts` around lines 23 -
25, The module-level MESA_API_KEY guard in the integration test file is aborting
Vitest collection instead of skipping these tests. Move the check out of
top-level execution and gate the suite or individual tests in the existing
MesaFilesystem integration test setup so they register as skipped when
MESA_API_KEY is missing, using the test suite entrypoints in
index.integration.test.ts rather than throwing during import.

Comment thread workspaces/mesa/src/filesystem/index.integration.test.ts Outdated
Comment thread workspaces/mesa/src/filesystem/index.ts
Comment thread workspaces/mesa/src/filesystem/index.ts
Comment thread workspaces/mesa/src/provider.ts
@warrenbhw warrenbhw force-pushed the warrenbhw/mesa-filesystem-integration branch from b25f445 to 35dd62f Compare June 29, 2026 18:17

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (2)
workspaces/mesa/src/filesystem/index.integration.test.ts (2)

212-215: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Reject rooted paths that escape the test sandbox.

path.join(this.root, normalized) is still not containment-safe here: inputs like ../sibling resolve outside this.root, so the adapter can read/write/delete sibling repo paths and break test isolation.

Suggested fix
   private toMesaPath(inputPath: string): string {
     const normalized = path.normalize(inputPath || '/');
     if (normalized === '/') return this.root;
-    return path.join(this.root, normalized);
+
+    const candidate = path.resolve(this.root, normalized.replace(/^\/+/, ''));
+    if (candidate !== this.root && !candidate.startsWith(`${this.root}/`)) {
+      throw new Error(`Path escapes rooted Mesa filesystem: ${inputPath}`);
+    }
+
+    return candidate;
   }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@workspaces/mesa/src/filesystem/index.integration.test.ts` around lines 212 -
215, The toMesaPath helper in the Mesa filesystem test adapter is not
containment-safe because path.join(this.root, normalized) can still escape the
sandbox for rooted or relative traversal inputs like ../sibling. Update
toMesaPath to canonicalize the candidate path and verify it stays within
this.root before returning it, rejecting any path that resolves outside the test
root. Use the existing toMesaPath method in index.integration.test.ts as the
place to enforce this boundary check.

36-41: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Skip the integration suite when Mesa credentials are absent.

These tests are still environment-gated in intent, but beforeAll currently throws and fails the run instead of marking the suite as skipped when MESA_API_KEY is missing. Gate the suite/conformance registration behind a boolean and use describe.skip when credentials are unavailable.

Suggested fix
 import { afterAll, beforeAll, describe, expect, it } from 'vitest';
@@
-let mesaTestEnv: MesaTestEnv | undefined;
+let mesaTestEnv: MesaTestEnv | undefined;
+const hasMesaApiKey = Boolean(process.env.MESA_API_KEY);
@@
 beforeAll(async () => {
   const apiKey = process.env.MESA_API_KEY;
 
   if (!apiKey) {
-    throw new Error('MesaFilesystem integration tests require MESA_API_KEY.');
+    return;
   }
@@
-describe('MesaFilesystem integration', () => {
+(hasMesaApiKey ? describe : describe.skip)('MesaFilesystem integration', () => {
@@
-createFilesystemTestSuite({
-  suiteName: 'MesaFilesystem Conformance',
-  createFilesystem: async () => {
-    const testRoot = mesaRepoPath(`conformance-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`);
-    return new RootedMesaFilesystem(createMesaFilesystem(), testRoot);
-  },
-  cleanupFilesystem: async fs => {
-    await fs.rmdir('/', { recursive: true, force: true }).catch(() => {});
-  },
-  capabilities: {
-    supportsAppend: true,
-    supportsBinaryFiles: true,
-    supportsMounting: false,
-    supportsForceDelete: true,
-    supportsOverwrite: true,
-    supportsConcurrency: true,
-    supportsEmptyDirectories: true,
-    deleteThrowsOnMissing: true,
-  },
-  testTimeout: 30000,
-});
+if (hasMesaApiKey) {
+  createFilesystemTestSuite({
+    suiteName: 'MesaFilesystem Conformance',
+    createFilesystem: async () => {
+      const testRoot = mesaRepoPath(`conformance-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`);
+      return new RootedMesaFilesystem(createMesaFilesystem(), testRoot);
+    },
+    cleanupFilesystem: async fs => {
+      await fs.rmdir('/', { recursive: true, force: true }).catch(() => {});
+    },
+    capabilities: {
+      supportsAppend: true,
+      supportsBinaryFiles: true,
+      supportsMounting: false,
+      supportsForceDelete: true,
+      supportsOverwrite: true,
+      supportsConcurrency: true,
+      supportsEmptyDirectories: true,
+      deleteThrowsOnMissing: true,
+    },
+    testTimeout: 30000,
+  });
+}

Also applies to: 256-276

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@workspaces/mesa/src/filesystem/index.integration.test.ts` around lines 36 -
41, The MesaFilesystem integration suite currently throws in beforeAll when
MESA_API_KEY is missing, which fails the run instead of skipping it. Update the
registration in index.integration.test.ts to compute a credentials-available
boolean first, then choose between describe and describe.skip for the
suite/conformance block. Keep the existing MesaFilesystem test setup inside the
gated describe so the integration tests are skipped cleanly when credentials are
absent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@workspaces/mesa/src/filesystem/index.integration.test.ts`:
- Around line 212-215: The toMesaPath helper in the Mesa filesystem test adapter
is not containment-safe because path.join(this.root, normalized) can still
escape the sandbox for rooted or relative traversal inputs like ../sibling.
Update toMesaPath to canonicalize the candidate path and verify it stays within
this.root before returning it, rejecting any path that resolves outside the test
root. Use the existing toMesaPath method in index.integration.test.ts as the
place to enforce this boundary check.
- Around line 36-41: The MesaFilesystem integration suite currently throws in
beforeAll when MESA_API_KEY is missing, which fails the run instead of skipping
it. Update the registration in index.integration.test.ts to compute a
credentials-available boolean first, then choose between describe and
describe.skip for the suite/conformance block. Keep the existing MesaFilesystem
test setup inside the gated describe so the integration tests are skipped
cleanly when credentials are absent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3a3efc3d-b6db-423c-8909-0eed466b10af

📥 Commits

Reviewing files that changed from the base of the PR and between b25f445 and 35dd62f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (20)
  • .changeset/few-planets-invite.md
  • MESA_INTEGRATION_PLAN.md
  • docs/src/content/en/docs/workspace/filesystem.mdx
  • docs/src/content/en/reference/workspace/mesa-filesystem.mdx
  • pnpm-workspace.yaml
  • workspaces/mesa/CHANGELOG.md
  • workspaces/mesa/README.md
  • workspaces/mesa/eslint.config.js
  • workspaces/mesa/lint-staged.config.js
  • workspaces/mesa/package.json
  • workspaces/mesa/src/filesystem/index.integration.test.ts
  • workspaces/mesa/src/filesystem/index.test.ts
  • workspaces/mesa/src/filesystem/index.ts
  • workspaces/mesa/src/index.ts
  • workspaces/mesa/src/provider.test.ts
  • workspaces/mesa/src/provider.ts
  • workspaces/mesa/tsconfig.build.json
  • workspaces/mesa/tsconfig.json
  • workspaces/mesa/tsup.config.ts
  • workspaces/mesa/vitest.config.ts
✅ Files skipped from review due to trivial changes (7)
  • workspaces/mesa/tsconfig.build.json
  • workspaces/mesa/CHANGELOG.md
  • workspaces/mesa/src/index.ts
  • workspaces/mesa/README.md
  • .changeset/few-planets-invite.md
  • docs/src/content/en/reference/workspace/mesa-filesystem.mdx
  • workspaces/mesa/lint-staged.config.js
🚧 Files skipped from review as they are similar to previous changes (10)
  • workspaces/mesa/vitest.config.ts
  • workspaces/mesa/eslint.config.js
  • workspaces/mesa/tsconfig.json
  • workspaces/mesa/src/provider.test.ts
  • workspaces/mesa/src/provider.ts
  • workspaces/mesa/tsup.config.ts
  • workspaces/mesa/package.json
  • pnpm-workspace.yaml
  • workspaces/mesa/src/filesystem/index.test.ts
  • workspaces/mesa/src/filesystem/index.ts

@warrenbhw warrenbhw force-pushed the warrenbhw/mesa-filesystem-integration branch from 35dd62f to 4641385 Compare June 29, 2026 18:36
@superagent-security superagent-security Bot removed the pr:flagged Superagent security flag label Jun 29, 2026
@warrenbhw warrenbhw force-pushed the warrenbhw/mesa-filesystem-integration branch from 4641385 to c28f61e Compare June 29, 2026 18:39
@superagent-security superagent-security Bot added the pr:flagged Superagent security flag label Jun 29, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@MESA_INTEGRATION_PLAN.md`:
- Around line 118-121: The Agent example in MESA_INTEGRATION_PLAN.md still uses
the unexpanded __GATEWAY_ANTHROPIC_MODEL_OPUS__ placeholder, so make the snippet
copy-pasteable by replacing it with a real model string or clearly labeling it
as docs-only; update the Agent initialization example (the one setting name,
model, and workspace) to use an actual value consistent with this repo’s docs
conventions, since placeholder expansion only happens in docs/src MDX files and
changesets.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 49d4cc19-5a01-4a0b-9a62-28248bf254cc

📥 Commits

Reviewing files that changed from the base of the PR and between 35dd62f and c28f61e.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (20)
  • .changeset/few-planets-invite.md
  • MESA_INTEGRATION_PLAN.md
  • docs/src/content/en/docs/workspace/filesystem.mdx
  • docs/src/content/en/reference/workspace/mesa-filesystem.mdx
  • pnpm-workspace.yaml
  • workspaces/mesa/CHANGELOG.md
  • workspaces/mesa/README.md
  • workspaces/mesa/eslint.config.js
  • workspaces/mesa/lint-staged.config.js
  • workspaces/mesa/package.json
  • workspaces/mesa/src/filesystem/index.integration.test.ts
  • workspaces/mesa/src/filesystem/index.test.ts
  • workspaces/mesa/src/filesystem/index.ts
  • workspaces/mesa/src/index.ts
  • workspaces/mesa/src/provider.test.ts
  • workspaces/mesa/src/provider.ts
  • workspaces/mesa/tsconfig.build.json
  • workspaces/mesa/tsconfig.json
  • workspaces/mesa/tsup.config.ts
  • workspaces/mesa/vitest.config.ts
✅ Files skipped from review due to trivial changes (9)
  • workspaces/mesa/CHANGELOG.md
  • workspaces/mesa/src/index.ts
  • .changeset/few-planets-invite.md
  • workspaces/mesa/tsup.config.ts
  • workspaces/mesa/tsconfig.build.json
  • workspaces/mesa/README.md
  • docs/src/content/en/reference/workspace/mesa-filesystem.mdx
  • workspaces/mesa/lint-staged.config.js
  • pnpm-workspace.yaml
🚧 Files skipped from review as they are similar to previous changes (8)
  • workspaces/mesa/src/provider.test.ts
  • workspaces/mesa/tsconfig.json
  • workspaces/mesa/eslint.config.js
  • workspaces/mesa/src/provider.ts
  • workspaces/mesa/vitest.config.ts
  • workspaces/mesa/package.json
  • workspaces/mesa/src/filesystem/index.test.ts
  • workspaces/mesa/src/filesystem/index.ts

Comment thread MESA_INTEGRATION_PLAN.md Outdated
Add a new @mastra/mesa workspace filesystem package backed by Mesa repos.

Document the provider, include focused unit and integration test coverage, and add the release changeset.
@warrenbhw warrenbhw force-pushed the warrenbhw/mesa-filesystem-integration branch from c28f61e to e6b154e Compare June 29, 2026 18:50

@superagent-security superagent-security Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superagent found 1 security concern(s).

Comment thread workspaces/mesa/src/filesystem/index.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@workspaces/mesa/src/filesystem/index.integration.test.ts`:
- Around line 65-68: The cleanup helpers, including deleteMesaTestRepo and the
other shared Mesa teardown paths in this test file, are swallowing all errors
with blanket catch blocks, which hides real mutation failures. Update the
cleanup logic to only ignore the expected “already gone/not found” case and
rethrow or fail on any other error, so repo/root deletion issues surface instead
of being silently skipped.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1634d51d-fc0b-4e19-ac37-95ebc080c7ac

📥 Commits

Reviewing files that changed from the base of the PR and between c28f61e and e6b154e.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (20)
  • .changeset/few-planets-invite.md
  • MESA_INTEGRATION_PLAN.md
  • docs/src/content/en/docs/workspace/filesystem.mdx
  • docs/src/content/en/reference/workspace/mesa-filesystem.mdx
  • pnpm-workspace.yaml
  • workspaces/mesa/CHANGELOG.md
  • workspaces/mesa/README.md
  • workspaces/mesa/eslint.config.js
  • workspaces/mesa/lint-staged.config.js
  • workspaces/mesa/package.json
  • workspaces/mesa/src/filesystem/index.integration.test.ts
  • workspaces/mesa/src/filesystem/index.test.ts
  • workspaces/mesa/src/filesystem/index.ts
  • workspaces/mesa/src/index.ts
  • workspaces/mesa/src/provider.test.ts
  • workspaces/mesa/src/provider.ts
  • workspaces/mesa/tsconfig.build.json
  • workspaces/mesa/tsconfig.json
  • workspaces/mesa/tsup.config.ts
  • workspaces/mesa/vitest.config.ts
✅ Files skipped from review due to trivial changes (7)
  • workspaces/mesa/vitest.config.ts
  • workspaces/mesa/src/index.ts
  • workspaces/mesa/tsconfig.json
  • workspaces/mesa/README.md
  • docs/src/content/en/reference/workspace/mesa-filesystem.mdx
  • workspaces/mesa/tsconfig.build.json
  • .changeset/few-planets-invite.md
🚧 Files skipped from review as they are similar to previous changes (10)
  • workspaces/mesa/tsup.config.ts
  • workspaces/mesa/src/provider.test.ts
  • workspaces/mesa/CHANGELOG.md
  • pnpm-workspace.yaml
  • workspaces/mesa/package.json
  • workspaces/mesa/src/provider.ts
  • workspaces/mesa/lint-staged.config.js
  • workspaces/mesa/eslint.config.js
  • workspaces/mesa/src/filesystem/index.test.ts
  • workspaces/mesa/src/filesystem/index.ts

Comment thread workspaces/mesa/src/filesystem/index.integration.test.ts
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I've addressed all CodeRabbit and Superagent review comments in commit b20320b on branch devin/1782760836-mesa-review-fixes. Since this PR is from a fork with maintainer_can_modify: false, I couldn't push directly here.

Changes made:

  1. Skip integration tests when MESA_API_KEY missing — uses describe.skip instead of throwing at module load (CodeRabbit)
  2. exists() no longer swallows arbitrary errors — only returns false for not-found; re-throws auth/network/SDK errors (CodeRabbit, Critical)
  3. bash() respects readOnly mode — calls assertWritable('bash') before delegating (Superagent P1)
  4. minItems: 1 on repos schema — rejects empty arrays at validation time instead of runtime (CodeRabbit)
  5. Cleanup helpers only suppress not-found errors — no longer blanket .catch(() => {}) (CodeRabbit)
  6. Trust policy exclusion TODO — added expiration date to revisit @mesadev/sdk provenance (Superagent P2)
  7. bash added to read-only unit test coverage

@warrenbhw you can cherry-pick this commit:

git fetch origin devin/1782760836-mesa-review-fixes
git cherry-pick b20320b06a1daa11068354524b088fceeed7b597

Comment thread workspaces/mesa/src/filesystem/index.ts
@superagent-security superagent-security Bot removed the pr:flagged Superagent security flag label Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements or additions to documentation needs-issue PR is missing a linked issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants