# Declined delegated-completion wake reproduction

This drives the real T3 Code server, HTTP/MCP transport, delegation service, effect worker, SQLite outbox and web client. It does not use the integration-test harness.

The provider is controlled to reproduce the triage adapter: a Node loader replaces only the Cursor SDK worker with the supplied JSON-line worker and changes the Cursor adapter's `activeSteeringInterruptsTools` capability from true to false. Both commits receive the same loader. No orchestration code is changed. Normal Cursor deliberately keeps mailbox notifications queued; this capability override is necessary to reach the reported non-interrupting adapter path.

The worker starts a Replay (dev) child through the parent's actual MCP session. Replay completes the child; the server claims and delivers its result. Every provider steer returns `revert_to_followup`, which the production Cursor adapter translates to `ProviderAdapterSteerDeclinedError`. A file gate then finishes the parent's active turn. Only the queued wake can start the second provider turn, which emits the visible `WAKE_RECEIVED` response.

Put hook.mjs and worker.mjs together. Put the scenario in scripts/scenarios in a checkout of current main, with dependencies installed. From that checkout run (HOOK_DIR is the directory holding the two worker files):

```sh
T3CODE_DEV_SEED=0 T3_SCENARIO_INHERIT_ENV='NODE_OPTIONS,CURSOR_API_KEY,T3CODE_DEV_SEED' NODE_OPTIONS="--import=$HOOK_DIR/hook.mjs" vp run scenarios:prove scripts/scenarios/declined-delegated-completion-wakes-parent.e2e.ts --base 555512fbe16db3b2249be3cd7fee9d23f7dc7ef5 --head 4bb57f251bb6632b6e6e808891e5334e6d7426bf --upload-command 'ghdrop upload'
```

A configured Cursor API key permits the production provider setup/catalog to initialize; the controlled worker sends no model request. State is fresh and synthetic on each side. Browser: runner-managed headless Chromium, 1280×800, light theme. Assertion: the parent displays its wake response after the first turn finishes. On base it remains idle with the completed child visible; on head the queued wake starts and completes.
