Registry Mirror
Skip to content

Conversation

@saphid

@saphid saphid commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Problem

FilesystemBrowseInput caps both partialPath and cwd at 512 characters (FILESYSTEM_PATH_MAX_LENGTH = 512), so the folder picker cannot list an existing directory whose absolute path exceeds 512 characters even though each component and the full path fit filesystem limits and workspace file contracts already allow 4096 characters.

Deterministic repro on origin/main (1b5100705afe81f5729f405183dfe678fcbe38a9)

Create an isolated temporary directory with three nested 180-character ASCII x segments and a child directory inside the deepest folder:

SEG=$(printf 'x%.0s' $(seq 1 180))
ROOT=$(mktemp -d /tmp/t3-browse-deep-XXXXXX)
DEEPEST="$ROOT/$SEG/$SEG/$SEG"
mkdir -p "$DEEPEST/child"

Call filesystem.browse (or paste "$DEEPEST/" into the web/mobile folder picker, which sends WS_METHODS.filesystemBrowse with { partialPath: "$DEEPEST/" }, length ~570). The RPC payload schema FilesystemBrowseInput in packages/contracts/src/filesystem.ts runs before apps/server/src/ws.ts dispatches to WorkspaceEntries.browse.

  • Observed: FilesystemBrowseInput rejects the request with SchemaError: Expected a value with a length of at most 512 at ["partialPath"] before WorkspaceEntries.browse runs (even though calling WorkspaceEntries.browse directly with the same input lists ["child"]).
  • Expected: The valid 570-character path passes schema validation, reaches WorkspaceEntries.browse, and returns entries: [{ name: "child", ... }] with parentPath === deepest.

Change

Introduce FILESYSTEM_BROWSE_PATH_MAX_LENGTH = 4096 in packages/contracts/src/filesystem.ts and apply it to partialPath and cwd on FilesystemBrowseInput, matching PROJECT_FILE_PATH_MAX_LENGTH in packages/contracts/src/project.ts while leaving FilesystemGetMetadataInput unchanged. Web (CommandPalette, ProjectRepositoriesSettings), mobile (AddProjectScreen), packages/client-runtime/src/state/filesystem.ts, and WorkspaceEntries.browse have no separate 512-character cap, so updating the shared contract unblocks all folder pickers and direct WS RPC callers.

Scope

Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.

Verification

  • Before (1b5100705afe81f5729f405183dfe678fcbe38a9): The new regression test in packages/contracts/src/filesystem.test.ts failed with SchemaError: Expected a value with a length of at most 512 at ["partialPath"], and the on-disk runtime repro rejected the 570-character partialPath at FilesystemBrowseInput while direct WorkspaceEntries.browse listed ["child"].
  • After (676b0f126b8e841bf444c91ef6059292052e36d6): vp test run packages/contracts/src/filesystem.test.ts passed (3/3 tests, covering a >512-char path, a 4096-char boundary path, and rejecting 4097-char partialPath/cwd), the on-disk runtime repro decoded the 570-character input and listed ["child"] with parentPath === deepest, and vp run check:changed exited 0 (format, lint, knip, typecheck across 39 packages, and 2 affected test files / 5 passed).
  • Before/after transcript: https://gist.github.com/saphid/cbf228b4cbf768be4ed2627e6348a4d9
  • Not shown: Interactive browser/mobile folder picker UI captures and Windows long-path (\\?\) behavior.

Authored by Gemini 4 Neon (Antigravity); reviewed by GPT-6.2 Sol (Codex).

Not shown

  • .github/pull_request_template.md:26 — The linked transcript shows the targeted test and disk probe, but not the reported check:changed run. Attach the exit-0 summary tied to HEAD 676b0f126b8e, or state that this run was reported but not independently verified.
  • .github/pull_request_template.md:30 — The fixture is reproducible manually, but no scenarios:prove run or paired picker capture is attached. If adding proof, seed the nested directory, enter its absolute path with a trailing slash in the Add Project picker, and assert the visible child row on head and its absence on base.
  • .github/pull_request_template.md:10 — Call 1b51007 the tested base rather than current origin/main; the local origin/main ref has advanced to 951f1f8, which independently reproduces the same rejection.

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Dec 2, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Dec 2, 2026
@macroscopeapp

macroscopeapp Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 0cfddb6

Macroscope's review found this PR approvable — Allows filesystem browsing with paths up to 4096 characters instead of 512. Existing read-only browsing behavior and validation safeguards remain unchanged.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Filesystem browse input validation now allows partialPath and optional cwd values up to 4096 characters. Tests verify acceptance at the limit and rejection beyond it.

Changes: Filesystem browse path validation

Layer / File(s) Summary
Set and test browse path limit
packages/contracts/src/filesystem.ts, packages/contracts/src/filesystem.test.ts
FilesystemBrowseInput allows partialPath and optional cwd values up to 4096 characters. Tests verify accepted lengths and reject longer partialPath values.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · up to 0cfdd

This change lets deep directory paths pass filesystem browse validation by raising the limit to 4096 characters. The change is small and tested, and no merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the FilesystemBrowseInput limits for partialPath and cwd rise so valid deep directories pass schema validation in filesystem.browse. It follows conventional commit sty…
Description check Passed The description follows the template well. It has Problem, Change, Scope, and Verification sections. The problem is stated with a deterministic repro, the change names the constant and affected files,…
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.
Full details: Title check

Explanation

The title names the main change: the FilesystemBrowseInput limits for partialPath and cwd rise so valid deep directories pass schema validation in filesystem.browse. It follows conventional commit style and matches the raw summary and objectives, which both describe the 512-to-4096 limit change in packages/contracts.

Full details: Description check

Explanation

The description follows the template well. It has Problem, Change, Scope, and Verification sections. The problem is stated with a deterministic repro, the change names the constant and affected files, scope explains why no issue is needed, and verification gives before and after results with a transcript link. The Not shown items are disclosed. Some gaps remain: the reported check:changed run is not independently tied to HEAD, no picker capture or scenarios:prove run is attached, and the template's agent-model attribution line is present but the description already names the model. These are non-critical, so the description is mostly complete.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between a271d53 and 0cfddb6.

Files selected for processing: 2

  • packages/contracts/src/filesystem.test.ts
  • packages/contracts/src/filesystem.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@saphid
saphid force-pushed the hunter/c-b6ef0a3e92 branch from cdc237e to a271d53 Compare December 2, 2026 22:58
@macroscopeapp
macroscopeapp Bot dismissed their stale review December 2, 2026 22:59

Dismissing prior approval to re-evaluate a271d53

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Dec 2, 2026
@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Dec 3, 2026
juliusmarminge and others added 2 commits December 3, 2026 00:01
# Conflicts:
#	packages/contracts/src/filesystem.test.ts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@macroscopeapp
macroscopeapp Bot dismissed their stale review December 3, 2026 00:05

Dismissing prior approval to re-evaluate 0cfddb6

@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Environment: Linux, real web app in Chromium, 1280×800, light theme, fresh per-commit databases and synthetic data.

On each commit, created the same synthetic directory tree with three 180-character components (a, b, c) and a child directory. Seeded a demo project and Replay thread on a fresh database; opened the thread, then Projects → Add project → Local folder. Filled the short root path and waited for a; filled the path through b and waited for c; filled the full path through c with trailing slash (593 characters), then checked for child and captured the picker. Base showed only '..' and 'Create & Add'; head showed '..', 'child', and 'Add'.

Scenario: An existing deep directory lists its child in the local folder picker

Proven: the scenario fails on base 33369749ea and passes on head 0cfddb6621.

Base 33369749ea Head 0cfddb6621
Result ❌ failed
ASSERTION_FAILED: expect.toBeVisible failed
locator: getByRole("dialog", name: "Command palette") >> getByText("child")
expected: visible
observed: no node (match count 0)
✅ passed
deep directory children Base 33369749ea: deep directory children Head 0cfddb6621: deep directory children
failure Base 33369749ea: failure
Recording Before After
Same scripted interaction Before recording After recording

Scenario source

Not shown:

  • The cwd field and the exact 4096-character boundary were not separately exercised; this real-app proof covers the reported partialPath folder-picker failure above 512 characters.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Dec 3, 2026
@juliusmarminge
juliusmarminge merged commit 7f08ea6 into pingdotgg:main Dec 3, 2026
43 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants