# C4 — before labelled adapter harness recording

Revision: [f012fa210d](https://git.cafe/pingdotgg/t3code/commit/f012fa210dbf464a5ea68fe9071ee377682f8d66).

Environment: Linux x86_64, Node 26.12.1, Effect 4.0.5, Vitest 5.0.5. Actual adapter, mocked SDK endpoints and native event stream; no HTTP server, model call, browser, viewport, theme, DPR or font scale. Effect TestClock governs adapter dates; observation timestamps below are live UTC.

SDK `session.command` is a normal native Promise with a controlled rejection. Receipt observation delegates to the original Deferred operations. The M3 hook rejects at the moment receipt success is assigned, before receipt resumers. MaxOpsBeforeYield changes fairness on the actual MixedScheduler; no sleeps or polling. Model slug in SDK payloads is a mock identifier.

Caption correction: native idle is emitted at step 7, the completed terminal is recorded at step 8, and the snapshot at step 11 follows that completion and the later request rejection. Only the snapshot heading is corrected; every JSON payload and timestamp below is unchanged. The original raw log retains its original event label.

## 1. 2026-11-03T04:09:50.362Z — C4 — environment

```json
{
  "kind": "CONTROLLED ADAPTER HARNESS; actual adapter, mocked SDK and native stream; no model or HTTP server",
  "caller": "start",
  "boundary": false,
  "maxOpsBeforeYield": "default",
  "node": "v26.12.1"
}
```

## 2. 2026-11-03T04:09:50.377Z — C4 — mock session.command sent

```json
{
  "sessionID": "native-C4",
  "messageID": "msg_000000000001TdxOV8TMb7T4XZ3pDMYhlccBgvkP",
  "command": "slow",
  "arguments": "330",
  "model": "anthropic/claude-sonnet",
  "parts": []
}
```

## 3. 2026-11-03T04:09:50.378Z — C4 — emit matching user receipt

```json
{
  "messageID": "msg_000000000001TdxOV8TMb7T4XZ3pDMYhlccBgvkP"
}
```

## 4. 2026-11-03T04:09:50.378Z — C4 — span.end

```json
{
  "name": "OpenCode.submitPrompt",
  "exit": "success",
  "callerSettled": false,
  "submitSettled": false,
  "receiptDone": true
}
```

## 5. 2026-11-03T04:09:50.379Z — C4 — span.end

```json
{
  "name": "OpencodeAdapter.startTurn",
  "exit": "success",
  "callerSettled": false,
  "submitSettled": true,
  "receiptDone": true
}
```

## 6. 2026-11-03T04:09:50.379Z — C4 — caller.returned

```json
{
  "exit": "success"
}
```

## 7. 2026-11-03T04:09:50.379Z — C4 — emit native idle before HTTP rejection

```json
{}
```

## 8. 2026-11-03T04:09:50.380Z — C4 — turn.terminal

```json
{
  "type": "turn.terminal",
  "driver": "opencode",
  "providerThreadId": "provider-thread:provider:opencode:native-thread:native-C4",
  "providerTurnId": "provider-turn:provider:opencode:native-turn:native-C4%3Aattempt%3Aattempt-opencode-C4",
  "runOrdinal": 1,
  "status": "completed",
  "failure": null,
  "threadDisposition": "reusable"
}
```

## 9. 2026-11-03T04:09:50.380Z — C4 — reject command after caller settled

```json
{
  "callerSettled": true
}
```

## 10. 2026-11-03T04:09:50.381Z — C4 — span.end

```json
{
  "name": "opencode.session.command",
  "exit": "OpenCodeRuntimeError: \n    at catch (/home/ubuntu/wt/pr-27677-base/packages/provider-opencode/src/server/OpenCodeRuntime.ts:157:7)\n    at file:///home/ubuntu/wt/pr-27677-base/node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/effect.js:779:40\n    at opencode.session.command (/home/ubuntu/wt/pr-27677-base/packages/provider-opencode/src/server/OpenCodeRuntime.ts:158:18)\n    at OpenCode.submitPrompt (/home/ubuntu/wt/pr-27677-base/packages/provider-opencode/src/server/adapter.ts:3276:22)\n    at OpenCode.submitPrompt (definition) (/home/ubuntu/wt/pr-27677-base/packages/provider-opencode/src/server/adapter.ts:2939:37)\n    at OpencodeAdapter.startTurn (/home/ubuntu/wt/pr-27677-base/packages/provider-opencode/src/server/evidence-controls.test.ts:195:13)\n    at OpencodeAdapter.startTurn (definition) (/home/ubuntu/wt/pr-27677-base/packages/provider-opencode/src/server/adapter.ts:3122:29) {\n  [cause]: TypeError: fetch failed\n      at /home/ubuntu/wt/pr-27677-base/packages/provider-opencode/src/server/evidence-controls.test.ts:296:23 {\n    [cause]: HeadersTimeoutError: Headers Timeout Error\n        at /home/ubuntu/wt/pr-27677-base/packages/provider-opencode/src/server/evidence-controls.test.ts:296:76\n  }\n}",
  "callerSettled": true,
  "submitSettled": true,
  "receiptDone": true
}
```

## 11. 2026-11-03T04:09:50.381Z — C4 — snapshot after idle completion and subsequent request failure

```json
{
  "turns": [
    {
      "id": "provider-turn:provider:opencode:native-turn:native-C4%3Aattempt%3Aattempt-opencode-C4",
      "providerThreadId": "provider-thread:provider:opencode:native-thread:native-C4",
      "nodeId": "node-opencode-C4",
      "runAttemptId": "attempt-opencode-C4",
      "nativeTurnRef": {
        "driver": "opencode",
        "nativeId": "msg_000000000001TdxOV8TMb7T4XZ3pDMYhlccBgvkP",
        "strength": "weak"
      },
      "ordinal": 1,
      "status": "completed",
      "startedAt": "1970-01-01T00:00:00.000Z",
      "completedAt": "1970-01-01T00:00:00.000Z",
      "turnTokenUsage": {
        "usageScope": "main_agent",
        "usageStatus": "unavailable",
        "hasSubagents": false
      }
    }
  ],
  "terminalCount": 1
}
```

## 12. 2026-11-03T04:09:50.381Z — C4 — final snapshot

```json
{
  "turns": [
    {
      "id": "provider-turn:provider:opencode:native-turn:native-C4%3Aattempt%3Aattempt-opencode-C4",
      "providerThreadId": "provider-thread:provider:opencode:native-thread:native-C4",
      "nodeId": "node-opencode-C4",
      "runAttemptId": "attempt-opencode-C4",
      "nativeTurnRef": {
        "driver": "opencode",
        "nativeId": "msg_000000000001TdxOV8TMb7T4XZ3pDMYhlccBgvkP",
        "strength": "weak"
      },
      "ordinal": 1,
      "status": "completed",
      "startedAt": "1970-01-01T00:00:00.000Z",
      "completedAt": "1970-01-01T00:00:00.000Z",
      "turnTokenUsage": {
        "usageScope": "main_agent",
        "usageStatus": "unavailable",
        "hasSubagents": false
      }
    }
  ],
  "terminals": [
    {
      "type": "turn.terminal",
      "driver": "opencode",
      "providerThreadId": "provider-thread:provider:opencode:native-thread:native-C4",
      "providerTurnId": "provider-turn:provider:opencode:native-turn:native-C4%3Aattempt%3Aattempt-opencode-C4",
      "runOrdinal": 1,
      "status": "completed",
      "failure": null,
      "threadDisposition": "reusable"
    }
  ]
}
```

## 13. 2026-11-03T04:09:50.382Z — C4 — mock session.abort

```json
{}
```
