Repository navigation
FIX-2344: Cursor runs work in deep checkouts - #4227
Conversation
Cursor's SDK keeps each workspace's state in ~/.cursor/projects/<the whole cwd flattened into one name>, with no truncation. A harness-manager checkout under an ordinary runs folder flattens past the 255-byte name limit, so the run failed with ENAMETOOLONG before doing anything. The cursor block now hands the SDK a short, deterministic link (<tmpdir>/fsd-cursor/<digest>) to such a directory. Directories that fit are passed unchanged, so existing agents' state stays where it was, and a resumed agent gets the same link its first turn did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NczDiD2NbgJTWT3D3ABjSA
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Second look + architecture passVerdict: the approach is right; no better shape found. Fixing it in Small items for the implementing agent to weigh (none blocking):
Evidence quality is good: the control that fails on main, the real-SDK child-process test, and the live run together cover the claim. The issue's "done when" (a Teammates-lab Cursor run on Jake's machine under the default runs folder) remains open, as the PR already says. Generated by Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 48264ad0e3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A shared /tmp/fsd-cursor made by one account refused every other account's links, and let its owner repoint them. The link root is now <tmpdir>/fsd-cursor-<uid>, created 0700, and refused if it isn't a private directory this user owns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NczDiD2NbgJTWT3D3ABjSA
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ce46c46f3a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The spec chmodded the real per-user link folder, which other specs' runs share; it now works under its own TMPDIR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NczDiD2NbgJTWT3D3ABjSA
#4198's merge dropped the README's inventory block (markers and all), which turns the lab's inventory test red on main and every PR. Regenerated with node scripts/inventory.mjs --write; identical to the table before that merge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NczDiD2NbgJTWT3D3ABjSA
|
Generated by Claude Code |
README stats tables are being removed on purpose; #4127 fixes main's red inventory check by dropping the table check instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NczDiD2NbgJTWT3D3ABjSA
|
We are solving this for cursor but isn't this likely an issue with all harnesses and task work trees? |
…T_MS; fix the config header (#4368) * FIX-2392: Teammates lab reads TEAMMATES_RUNS and TEAMMATES_RUN_TIMEOUT_MS; fix the config header The config header said claude-code was the default harness and listed only codex; the host defaults to cursor and takes all three. The runs folder and the run budget could only be changed by editing the config; both are now environment settings, and a run budget that isn't a positive whole number stops the lab at start. The README's ENAMETOOLONG note is dropped: FIX-2344 (#4227) fixed Cursor runs in deep checkouts, so no short-path default is needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NczDiF234bZVCmfw6uKVf1 * FIX-2392: check the run budget with harness-manager's assertPositiveInt Reuses the package's guard, so a value past the largest timer delay also fails at start instead of on a claimed run. Passes the budget straight through; the host already falls back to its default on undefined. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NczDiF234bZVCmfw6uKVf1 --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Jake · project thread
Fixes FIX-2344 (closes #4220). Bug route, no spec.
Problem
A Cursor coding run under harness-manager's normal runs folder (e.g. the Teammates lab's
labs/teammates/.fsdev/teammates-runs/) failed withENAMETOOLONGbefore doing any work.Root cause (read from the installed
@cursor/sdk@1.0.40): the SDK keeps per-workspace state in~/.cursor/projects/<cwd with every run of non-alphanumerics turned into "-">, with no truncation, and also writes transcripts, MCP descriptors and so on under that folder. A harness-manager checkout is ~242 characters before its root, so the flattened name passes the 255-byte filename limit.Fix
In
@flow-state-dev/cursor, not harness-manager (the quirk is Cursor's; Codex and Claude Code run fine at that depth, and changing harness-manager's path derivation would move every existing run's checkout, branch and record):src/workspace-alias.ts: when the SDK's name forcwdwould pass 255 bytes, hand the SDK a short link<tmpdir>/fsd-cursor/<sha256(path)[:16]>→ the real directory (a junction on Windows). The link is a function of the path, so a resumed agent gets the same link and finds its earlier state. A directory that fits is passed unchanged, so existing agents' state is untouched.openAgentroutes the resolvedcwdthrough it before create/resume (covers the child-process runtime too, since that takes the same options).@flow-state-dev/cursor.Evidence
test/agent.spec.ts, "too deep"): withsrc/agent.tsreverted to main it fails withexpected 285 to be less than or equal to 255; with the fix it passes, and resume gets the same link.test/installed-sdk.spec.ts): runs the installed SDK'sAgent.createin a child with a temp HOME and a key the SDK refuses locally (no network). The deep path getsENAMETOOLONG(the premise); the link gets past it to the API-key refusal, and the state folder the SDK made has exactly the namecursorProjectNamepredicts, so the copied naming rule is pinned to the SDK.cursorAgentwithcomposer-2.5and a real key, in a 268-character git checkout shaped like a harness-manager one: run completed and committedhelloin the real checkout.@flow-state-dev/cursor: 176/176 tests, typecheck and eslint clean.Not done here: a Teammates-lab Cursor run on Jake's machine under the default runs folder, which is the issue's "done when".
Generated by Claude Code