test(server): re-record Cursor replay fixtures and cover skills live #13493
t3code/codex-turn-mapping fromrefs/pull/13493/head·merged by juliusmarminge View on GitHubBuilds on #13499 (merged), which makes Cursor V2 pass local.settingSources. The transcripts here carry that field in agent.open.
The Cursor replay transcripts were recorded in June against @cursor/sdk 1.0.19; the server now runs 1.0.31. They predate the thinking-delta stream, run usage, and today's tool-call shapes, so replays were checking behavior Cursor no longer shows. A skill unit test also used a hand-built runner where a live fixture can cover the same path.
What changed#
Recorder (first commit). The recorder opened every agent with full access, but five fixtures replay with a read-only or workspace-write policy. Replay matches the agent.open frame exactly, so any re-recording of those fixtures could not replay. The recorder now takes each scenario's runtime-policy override. It also:
- sanitizes workspace paths in object keys (grep results are keyed by path);
- maps the recording workspace's parent to
/tmp; - waits one timer tick before a mid-tool cancel. Cancelling inside the SDK's
tool-call-startedcallback leaves an unhandledAbortErrorin@cursor/sdkthat kills the recorder process (see below).
Re-recorded fixtures (second commit). Nine of the ten Cursor transcripts were re-recorded live with composer-2.5: simple, multi_turn, message_steering, provider_thread_resume, queued_turn, todo_list, subagent, tool_call_read_only, and turn_interrupt_mid_tool. proposed_plan was left as is. In an empty workspace, the plan-mode agent searches outside it (/tmp, the recording host's cache and worktree) and quotes those files in its plan, so the transcript would publish host paths. Three output assertions pinned the June wording and item order and now match today's run:
subagent: a reasoning segment now follows the subagents.todo_list: the progress lines are reworded and there are more reasoning segments.tool_call_read_only: the progress line is compared after trimming, because trailing newlines vary between runs. Grok's transcript shares this assertion.
None of these differences was an adapter bug.
Skill fixture (third commit). The new skill_invocation fixture seeds .cursor/skills/review/SKILL.md and sends $review README.md. Replay matches run.start exactly, so the adapter's rewrite to /review is now proven through the full orchestrator. It was recorded with #13499's settingSources in place, so the SDK loads the workspace skill natively: the model reads SKILL.md straight from the /review invocation, with no workspace search, and answers from it. This replaces the unit test "sends discovered skills as native slash invocations". Fixture inputs gained workspaceFiles, which the recorder and the replay workspace both commit.
The task-lifecycle unit test stays, because a live run can't be made to end without a task completion. Its frames now follow the recorded shape: a partial-tool-call before tool-call-started, and subagentType: {kind: "unspecified"} with agentId and mode.
Not done#
The proposed tool_call_ls_lints fixture, which would have replaced the ls/readLints projection unit test, can't be produced live with this SDK:
- The local SDK's diagnostics provider is a stub that always returns zero diagnostics. Diagnostics come from the IDE, so
readLintscan never return errors locally. - No model advertises an
lstool:composer-2.5,gpt-5.4, andclaude-sonnet-4-6all list directories throughShellorGlob. No Cursor transcript in the repo has ever recordedls.
The unit test stays.
Verification#
vp test run src/orchestration-v2/testkit/OrchestratorReplayFixtures.integration.test.ts src/orchestration-v2/testkit/OrchestratorReplayRecovery.integration.test.ts src/orchestration-v2/testkit/OrchestratorReplayFixtures.contract.test.ts src/orchestration-v2/Adapters/CursorAdapterV2.test.ts src/orchestration-v2/Adapters/CursorAdapterV2.testkit.test.ts scripts/cursorReplayRecordingWorkspace.test.ts: 102 passed, which includes all 75 replay fixtures across providers.- Negative check: seeding the skill at a non-skill path makes
skill_invocationfail with arun.startframe mismatch. - Hermeticity: Cursor replays now run with an empty
HOME. Before, withHOMEpointing at a directory holding a user-levelreviewskill,skill_invocationstill passed when the workspace skill was moved to a non-skill path. It now fails with arun.startmismatch, and the seeded fixture still passes under thatHOME. The Cursor replay and recovery suites pass (12), and so do the adapter and contract tests (22). vp exec tsc --noEmit -p .inapps/server: no errors.vp linton touched files: one warning that already exists on the base branch.- Transcripts checked for API keys, auth headers, and host paths: none.
- After rebasing onto #13499: all recorded transcripts carry #13499's
settingSourcesfield. The first nine gained only that field, inserted byte-identically to #13499's edit.skill_invocationwas re-recorded live with the fix. The Cursor replay and recovery suites pass (12); the adapter, testkit, contract, and recorder-workspace tests pass (26). The hermeticity and negative checks were re-run and hold. Servertscshows no TS errors or warnings.vp run knip:checkpasses (the earlier unused-export failure was fixed on the base by #13502). - Not run: repo-wide checks.
Model: Claude Opus 5.5 (Claude Code)
🤖 Generated with Claude Code
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XXL
Approvability#
Verdict: Not approved
Macroscope's review found this PR not approvable — This is primarily a test-only Cursor fixture refresh with no product-path or default-behavior change. Human review is warranted for the unresolved temporary HOME directory lifecycle issue in the replay layer, which may prevent scoped cleanup.
Not approved because:
- Per-review cost limit exceeded (workspace setting). Approvability relies on correctness review in order to determine eligibility
Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
ℹ️ No successful
mainbaseline artifact is available yet. This run establishes the initial measurement.Provider Metric Main baseline This PR Impact PR ceiling Codex Total thread wire — 4.9 KiB — 6.8 KiB ✅ Codex Thread snapshot wire — 3.7 KiB — 4.9 KiB ✅ Codex Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅ Codex Live turn WebSocket decoded — 20.4 KiB — 29.3 KiB ✅ Codex Live turn messages — 2 — 8 ✅ Claude Total thread wire — 4.9 KiB — 6.8 KiB ✅ Claude Thread snapshot wire — 3.7 KiB — 4.9 KiB ✅ Claude Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅ Claude Live turn WebSocket decoded — 20.8 KiB — 29.3 KiB ✅ Claude Live turn messages — 2 — 8 ✅ Baseline: unavailable · PR result:
cd3ec2f· Source CI: failureScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
- Codex decoded thread snapshot: 106.1 KiB
- Claude decoded thread snapshot: 106.4 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
- @@ -618,3 +620,6 @@618620 ServerConfig,619621 makeReplayServerConfig(transcript.scenario).pipe(Effect.orDie),620622 ).pipe(Layer.provide(NodeServices.layer));623+ // Skill discovery also scans user roots under HOME; an empty HOME keeps624+ // replays from picking up the host's own skills.625+ const hostEnvironmentLayer = Layer.effect(
This layer acquires a scoped temporary directory, so it should use the scoped layer constructor to keep the directory alive for the layer's lifetime and run its finalizer when the layer scope closes.
Suggested change627+ const hostEnvironmentLayer = Layer.scoped(Posted via Macroscope — Effect Service Conventions juliusmarminge merged this393d7b3
juliusmarminge closed this
Sign in to join this conversation.
Macroscope skipped reviewing this pull request. Per-review cost limit exceeded (workspace setting).
This review would cost an estimated $19.76, which exceeds your per-review limit of $15.00.
The top 3 files driving up this estimate:
apps/server/src/orchestration-v2/testkit/fixtures/subagent/cursor_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/todo_list/cursor_transcript.ndjsonapps/server/src/orchestration-v2/testkit/fixtures/provider_thread_resume/cursor_transcript.ndjsonTip
To get this pull request reviewed, you can:
@macroscope-appon this PR to request a manual review (monthly spend limits still apply)..macroscope/ignore.md— note that creating this file replaces Macroscope's built-in default ignores rather than extending them.