# C7 — after labelled adapter harness recording

Revision: [134aea71f0](https://git.cafe/pingdotgg/t3code/commit/134aea71f0c861f362534d7ffeab390bfdb83d42).

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.

## 1. 2026-11-03T04:09:49.461Z — C7-EOF — 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:49.464Z — C7-EOF — mock session.command sent

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

## 3. 2026-11-03T04:09:49.464Z — C7-EOF — emit matching user receipt

```json
{
  "messageID": "msg_0000000000012X7zKD3OdUKA1WhK6h2wX8yJFXr5"
}
```

## 4. 2026-11-03T04:09:49.465Z — C7-EOF — span.end

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

## 5. 2026-11-03T04:09:49.465Z — C7-EOF — span.end

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

## 6. 2026-11-03T04:09:49.465Z — C7-EOF — caller.returned

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

## 7. 2026-11-03T04:09:49.465Z — C7-EOF — reject command after caller settled

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

## 8. 2026-11-03T04:09:49.466Z — C7-EOF — span.end

```json
{
  "name": "opencode.session.command",
  "exit": "OpenCodeRuntimeError: \n    at catch (/home/ubuntu/wt/pr-27677/packages/provider-opencode/src/server/OpenCodeRuntime.ts:157:7)\n    at file:///home/ubuntu/wt/pr-27677/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/packages/provider-opencode/src/server/OpenCodeRuntime.ts:158:18)\n    at OpenCode.submitPrompt (/home/ubuntu/wt/pr-27677/packages/provider-opencode/src/server/adapter.ts:3278:22)\n    at OpenCode.submitPrompt (definition) (/home/ubuntu/wt/pr-27677/packages/provider-opencode/src/server/adapter.ts:2939:37)\n    at OpencodeAdapter.startTurn (/home/ubuntu/wt/pr-27677/packages/provider-opencode/src/server/evidence-controls.test.ts:195:13)\n    at OpencodeAdapter.startTurn (definition) (/home/ubuntu/wt/pr-27677/packages/provider-opencode/src/server/adapter.ts:3124:29) {\n  [cause]: TypeError: fetch failed\n      at /home/ubuntu/wt/pr-27677/packages/provider-opencode/src/server/evidence-controls.test.ts:296:23 {\n    [cause]: HeadersTimeoutError: Headers Timeout Error\n        at /home/ubuntu/wt/pr-27677/packages/provider-opencode/src/server/evidence-controls.test.ts:296:76\n  }\n}",
  "callerSettled": true,
  "submitSettled": true,
  "receiptDone": true
}
```

## 9. 2026-11-03T04:09:49.467Z — C7-EOF — actual adapter request-error guard evaluated

```json
{
  "receiptDone": true,
  "callerSettled": true,
  "submitSettled": true,
  "stack": "    at Proxy.isDoneUnsafe (/home/ubuntu/wt/pr-27677/packages/provider-opencode/src/server/evidence-controls.test.ts:259:21)\n    at /home/ubuntu/wt/pr-27677/packages/provider-opencode/src/server/adapter.ts:2994:24\n    at file:///home/ubuntu/wt/pr-27677/node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/effect.js:1417:96"
}
```

## 10. 2026-11-03T04:09:49.467Z — C7-EOF — snapshot after request failure before idle

```json
{
  "turns": [
    {
      "id": "provider-turn:provider:opencode:native-turn:native-C7-EOF%3Aattempt%3Aattempt-opencode-C7-EOF",
      "providerThreadId": "provider-thread:provider:opencode:native-thread:native-C7-EOF",
      "nodeId": "node-opencode-C7-EOF",
      "runAttemptId": "attempt-opencode-C7-EOF",
      "nativeTurnRef": {
        "driver": "opencode",
        "nativeId": "msg_0000000000012X7zKD3OdUKA1WhK6h2wX8yJFXr5",
        "strength": "weak"
      },
      "ordinal": 1,
      "status": "running",
      "startedAt": "1970-01-01T00:00:00.000Z",
      "completedAt": null
    }
  ],
  "terminalCount": 0
}
```

## 11. 2026-11-03T04:09:49.467Z — C7-EOF — close native stream at explicit milestone

```json
{}
```

## 12. 2026-11-03T04:09:49.468Z — C7-EOF — turn.terminal

```json
{
  "type": "turn.terminal",
  "driver": "opencode",
  "providerThreadId": "provider-thread:provider:opencode:native-thread:native-C7-EOF",
  "providerTurnId": "provider-turn:provider:opencode:native-turn:native-C7-EOF%3Aattempt%3Aattempt-opencode-C7-EOF",
  "runOrdinal": 1,
  "failureItemOrdinal": 101,
  "status": "failed",
  "failure": {
    "class": "transport_error",
    "message": "OpenCode event stream ended unexpectedly.",
    "code": null,
    "retryable": null
  },
  "threadDisposition": "broken"
}
```

## 13. 2026-11-03T04:09:49.469Z — C7-EOF — final snapshot

```json
{
  "turns": [
    {
      "id": "provider-turn:provider:opencode:native-turn:native-C7-EOF%3Aattempt%3Aattempt-opencode-C7-EOF",
      "providerThreadId": "provider-thread:provider:opencode:native-thread:native-C7-EOF",
      "nodeId": "node-opencode-C7-EOF",
      "runAttemptId": "attempt-opencode-C7-EOF",
      "nativeTurnRef": {
        "driver": "opencode",
        "nativeId": "msg_0000000000012X7zKD3OdUKA1WhK6h2wX8yJFXr5",
        "strength": "weak"
      },
      "ordinal": 1,
      "status": "failed",
      "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-C7-EOF",
      "providerTurnId": "provider-turn:provider:opencode:native-turn:native-C7-EOF%3Aattempt%3Aattempt-opencode-C7-EOF",
      "runOrdinal": 1,
      "failureItemOrdinal": 101,
      "status": "failed",
      "failure": {
        "class": "transport_error",
        "message": "OpenCode event stream ended unexpectedly.",
        "code": null,
        "retryable": null
      },
      "threadDisposition": "broken"
    }
  ]
}
```

## 14. 2026-11-03T04:09:49.469Z — C7-EOF — mock session.abort

```json
{}
```
