Skip to content

fix(files): accept files/ VFS paths in v2 file describe, rename and delete - #9504

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/files-accept-vfs-paths
Oct 31, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
fix/files-accept-vfs-paths

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • files describe, files rename and files delete (v2 GET /files/[fileId]/metadata, PATCH/DELETE /files/[fileId]) now take a file's exact files/<folder>/<name> VFS path as well as its id — the same form files read, glob and listings already print, and the form the text route already accepts
  • Mothership's agent addresses files by path, so these commands failed with Invalid file id (~300 calls a week), each costing a wasted model round plus a listing call to recover the id
  • Path resolution lives in the shared resolveActiveWorkspaceFileContext: a files/ path resolves to an id inside the asserted workspace first, then the canonical load, workspace check and use-case authorization run on that id unchanged. Id inputs take the exact same path as before
  • Exact-only lookup (no name or listing fallback), workspace files only — chat uploads, owned files and archived files are never reachable by path; dot segments are rejected
  • Regenerated the CLI v2 API, OpenAPI, MCP operations and CLI docs (description + parameter schema only)

Type of Change

  • Bug fix

Testing

  • New lib/workspace-files/__integration__/file-path-references.integration.ts against real Postgres: 6/6 green; with the resolver reverted 5/6 go red (the 6th is a guard that uploads stay unreachable)
  • bun run lint, block registry check, check:api-validation:strict, check:openapi, check:cli-api, check:mcp-operations, check:cli-docs, check:v2-route-table, check:utils, check:comment-hygiene, check:test-patterns, check:explicit-any, check:file-names, check:source-conventions
  • Type-check, full check:audits and the test suites run in CI

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Oct 31, 2026 7:36am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issues were found.

Summary

Adds files/… paths to file describe, rename, and delete while retaining the existing file access checks.

  • File describe, rename, and delete calls accept listed workspace file paths.

Review checks were read-only; tests were not run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[File id or files path] --> B{Path?}
  B -->|Yes| C[Find active workspace candidates]
  C --> D[Require one full path match]
  D --> E[Load file by id]
  B -->|No| E
  E --> F[Check workspace and access]
  F --> G[Describe, rename, or delete]
Loading

Reviews (2) · Last reviewed commit: "fix(files): match VFS paths as listings ..." · Reviewed by Greptile

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 9 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 9 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

This branch was previously deployed

1 inactive deployment
Preview — e36a75e1 Deployed Oct 31, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant