# PR #22761 evidence: OpenCode 1.x context usage (SYNTHETIC data)

- before: `8acbefefc51b4d281dcd04108c82baa1ab902b0e` (merge-base)
- after: `0f40a81e0c82bee35ff625b7b965524c45e88e14` (PR head)
- opencode 1.18.18, so the v1 adapter is the one the PR changed. Each side ran one real `node apps/server/src/bin.ts start --base-dir /tmp/ev-22761/home-<side>` server with empty isolated state. The OpenCode binary was the fixture wrapper, pointed at a local OpenRouter-shaped stub. Both sides ran the identical driver sequence.
- The stub chooses its mode per request from the model id: `z-ai/glm-5.3-flash` single, `z-ai/glm-multi` multi, `z-ai/glm-nousage` nousage, `z-ai/glm-err` returns 400. `acme/stub-a` is a non-OpenRouter `@ai-sdk/openai-compatible` provider with a 64000 context limit.
- Where the "Server" values come from: `orchestration_events` (`provider-turn.updated`, stream_id = thread) and `orchestration_v2_projection_provider_turns`, read with `sqlite3 -readonly` after the server stopped. `orchestration_v2_events` exists but holds 0 rows on this schema.
- Where the "Client" values come from: `orchestration.subscribeThread` stream frames, plus a final `orchestration.getThreadProjection`.

| Row | before (8acbefe) | after (0f40a81) | match expected? |
|---|---|---|---|
| R1 openrouter single | tokenUsage absent in all 3 events, the projection row, and client frames. turnTokenUsage complete, in 12000 / cached 1000 / creation 0 / out 32 / reasoning 0 | tokenUsage `{used 12032, max 128000, in 12000, cached 1000, out 32, reasoning 0}` on the completed event (seq 40), the projection row, and the client event and final projection. The running events (26, 28) carry none. turnTokenUsage identical to before | yes |
| R2 openrouter multi (2 steps: glob tool call, then text) | tokenUsage absent. turnTokenUsage complete, 21500 / 1500 / 0 / 72 / 0 | tokenUsage = last step only, `{used 12032, max 128000, in 12000, cached 1000, out 32}`. turnTokenUsage 21500 / 1500 / 72, identical to before | yes |
| R3b nousage (step finishes, no usage chunk) | tokenUsage absent. turnTokenUsage complete, all 0 | tokenUsage **present, all 0**: `{used 0, max 128000, in 0, cached 0, out 0, reasoning 0}`. turnTokenUsage complete all 0, same as before. Run completed, no crash | yes, against the matrix's corrected expectation (all-zero). The brief's "absent" holds only for R3a |
| R3a 400 before any step (zero owned steps) | tokenUsage absent. turnTokenUsage `{unavailable}`. Run failed | Same as before: tokenUsage absent, turnTokenUsage unavailable, run failed, no crash | yes |
| R4 acme/stub-a (non-OpenRouter) | tokenUsage absent. turnTokenUsage 12000 / 1000 / 32 | tokenUsage `{used 12032, max 64000, in 12000, cached 1000, out 32}`. turnTokenUsage identical to before | yes. Note the behaviour change: the meter now appears for non-OpenRouter 1.x models |

Notes:
- The stub log also shows `google/gemini-nano-banana-2.1` requests on both sides. These are OpenCode's title-generation calls, which are not turn steps and are not counted in any value above.
- Not evidenced: no catalog-pending or catalog-failure run (maxTokens null), no OpenCode 2.x run, and no UI/meter screenshot (browser use was not authorized).

Driver sha256:
```
67a263975d72db0294bdc1fb551a22c7f791a7fa1fc3fec98523d9dd57347046  capture.mjs
abc10a87f70d66efeea2487975458dfbff7f471fd109ab6a98db52bf7f4a7f71  stub.ts
32937194aeada94ed1fe0d2d17b0e771f2e046cb323560b332c0decec12c5ded  extract.sh
```
