Add Cursor SDK orchestration replay support

- Wire Cursor adapter and provider session handling into orchestration v2
- Add replay fixtures, recording script, and coverage for Cursor turn flows
- Update docs and debug timeline mapping for Cursor events
This commit is contained in:
Julius Marminge committed 2026-08-15 16:49:00 +02:00
1 parent 4fae73ee08
commit ce64e37094
50 files changed
+7163 -201

No files matched your search

@@ -84,10 +84,16 @@ Claude receives an HTTP MCP server in its query options:
The adapter logs only whether MCP configuration exists; it does not log the
server headers or token.
### Cursor Agent SDK V2
Cursor receives the same authenticated HTTP MCP endpoint through the SDK's
`mcpServers` agent and send options. The adapter passes the authorization header
to the SDK but projects only redacted option metadata into protocol diagnostics.
### Initial Provider Support
The initial V2 provider adapters are Codex and Claude Agent SDK. Capability
discovery still reports other registered provider instances, but marks them
The V2 provider adapters are Codex, Claude Agent SDK, and Cursor Agent SDK.
Capability discovery still reports other registered provider instances, but marks them
unavailable for orchestration when no V2 adapter exists. This keeps provider
selection model-visible without allowing a request that cannot run.
@@ -293,6 +299,6 @@ Coverage includes:
- inheritance and per-thread provider overrides; and
- idempotent retries.
Provider adapter tests separately verify Codex and Claude MCP injection, and
Provider adapter tests separately verify Codex, Claude, and Cursor MCP injection, and
the provider-session manager test verifies that credentials exist before an
adapter opens and are revoked when it closes.
+7 -2
View File
@@ -118,6 +118,10 @@ Codex replay transcript
Claude replay transcript
-> Claude Agent SDK query() outbound options and yielded SDKMessage chunks
-> consumed by ClaudeAdapter
Cursor replay transcript
-> Cursor Agent SDK open/send calls and ordered onDelta/run results
-> consumed by CursorAdapter
```
Fixtures should preserve raw provider evidence as closely as possible. Expected V2 events or projections are assertions, not fixture input.
@@ -129,7 +133,8 @@ SDK output; it does not test the SDK's own subprocess or transport parser.
Provider transcript recorders live with the server orchestration testkit, not with provider client
packages. Use `bun run record:codex-replay -- --scenario <name>` for Codex app-server transcripts
and `bun run record:claude-replay -- --scenario <name>` for Claude Agent SDK transcripts.
and `bun run record:claude-replay -- --scenario <name>` for Claude Agent SDK transcripts. Use
`pnpm --filter t3 record:cursor-replay -- --scenario <name>` for Cursor Agent SDK transcripts.
## Contract Test Levels
@@ -201,7 +206,7 @@ Testing infrastructure should be built before production rewrites:
2. Effect service definitions.
3. provider runtime transport abstraction.
4. generic replay runtime.
5. Codex and Claude transcript loaders for app-owned provider replay fixtures.
5. Codex, Claude, and Cursor transcript loaders for app-owned provider replay fixtures.
6. projection reducer tests for core invariants.
7. full command-to-projection integration tests.
8. production layers.