Skip to content

Commit e072b3b

Browse files
wthrbtnclaude
andcommitted
freshen(opencode-ci-harness): final step events are fixed in v2.2.3; older v2 also drops the last step_start
Classification: version-drift Source: anomalyco/opencode#53207 (closed 2026-10-30, COMPLETED, by PR #60475); merge commit dbd7202f52 is contained in tags v2.2.3..v2.2.6. Evidence: mock chat-completions endpoint through the runner. v2.1.4: step_start,tool_use,step_finish,step_start,tool_use,tool_use,step_finish,text (no boundaries for the last step) and a text-only run emits only text. v2.2.6: every step has step_start and step_finish. session export carries messages[].tokens on both. Before: SKILL.md events table - 'the final one is often missing; do not require it' (no version, step_start not mentioned) After: the gap is scoped to before v2.2.3 and covers step_start, so the turn count caveat is stated Co-Authored-By: Claude Fable 5.2 <[email protected]>
1 parent b70ed07 commit e072b3b

4 files changed

Lines changed: 6 additions & 4 deletions

File tree

‎.claude-plugin/marketplace.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@
765765
"name": "opencode-ci-harness",
766766
"source": "./",
767767
"description": "Run opencode (v2) CLI as a headless, fully-isolated test harness against any OpenAI-, Responses- or Messages-compatible endpoint (local inference engine or remote API), or against any provider…",
768-
"version": "0.20261109.4",
768+
"version": "0.20261109.5",
769769
"author": {
770770
"name": "Jörgen"
771771
},

‎.claude/skills/opencode-ci-harness/SKILL.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,13 @@ Every line: `{type, timestamp, sessionID, ...}`.
121121
| `text` | `part.text` |
122122
| `reasoning` | `part.text` — emitted only with `run --thinking` (the runner passes it) |
123123
| `tool_use` | `part.tool`, `part.state.status` (`completed`\|`error`), `part.state.input`, `part.state.output` — one event per call, after it settles |
124-
| `step_finish` | `part.reason`, `part.tokens`, `part.cost` — the final one is often missing; do not require it |
124+
| `step_finish` | `part.reason`, `part.tokens`, `part.cost` |
125125
| `error` | `error.message` |
126126

127127
Tool names: `shell` (not `bash`), `read`, `glob`, `grep`, `edit`. Turn count = `step_start` count.
128128

129+
Before v2.2.3 the last step usually loses its `step_finish` and often its `step_start` (a text-only run emits just `text`): require neither, expect the turn count one low, and read the last step's tokens from `opencode session export` (`messages[].tokens`).
130+
129131
## Diagnose
130132

131133
| Symptom | Cause | Next step |

‎.claude/skills/opencode-ci-harness/references/known-gaps.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
| No assertion DSL or scenario-file format | `scripts/assert-tool-sequence.sh`; prompts in `scenario-bank.md` |
99
| No `--max-turns` flag | `agent.build.steps` in config (runner `--max-turns`) |
1010
| Exit code is 1 after any `error` event, even when a retried step then succeeded | Decide pass/fail from events: last step completed + expected tools + final text |
11-
| Final `step_finish` often missing from `--format json` | Never require it; read final-step tokens from `opencode session export` |
11+
| Before v2.2.3: the last step's `step_finish` and often its `step_start` are missing from `--format json` | Upgrade; on older v2 require neither and read final-step tokens from `opencode session export` |
1212
| Auto-compaction summaries appear as ordinary `text` events | Keep scenarios below the compaction threshold, or match final text on content, not position |
1313
| A killed run leaves its session resumable; any opencode service sharing that data dir resumes it unattended | Never share `XDG_DATA_HOME`; delete the scratch home (runner default) |
1414
| Wedged tunnel: zero events while `/v1/models` still answers | Connect to the engine directly instead of through the tunnel; restart the run |

‎.claude/skills/opencode-ci-harness/references/sources.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Freshen mode probes these rows first.
1919
| OAuth provider refresh stores the returned (rotated) refresh token | https://github.com/anomalyco/opencode/blob/v2.0.28/packages/core/src/plugin/provider/chatgpt.ts | 2026-10-14 | v2.0.28 |
2020
| Legacy `auth.json` not imported into a schema-bootstrapped DB; `auth import` reads an export array | local run (credential table empty after bootstrap) + https://github.com/anomalyco/opencode/blob/v2.0.28/packages/cli/src/commands/handlers/auth/import.ts | 2026-10-14 | v2.0.28 |
2121
| Killed standalone session resumed by background service sharing the data dir (open) | https://github.com/anomalyco/opencode/issues/55076 | 2026-10-14 | — |
22-
| Final `step_finish` dropped in `--format json` (open; reproduced locally) | https://github.com/anomalyco/opencode/issues/53207 | 2026-10-14 | — |
22+
| Final `step_finish` dropped in `--format json`: closed 2026-10-30 by PR #60475 (reconcile emits the step boundaries the live stream missed), merge commit `dbd7202f52`, first tag v2.2.3. With a mock endpoint: v2.1.4 ends a tool run on `text` with neither `step_start` nor `step_finish` for the last step and emits only `text` for a text-only run; v2.2.6 emits both | https://github.com/anomalyco/opencode/issues/53207, https://github.com/anomalyco/opencode/pull/60475 | 2026-10-14 | fixed in v2.2.3 |
2323
| Exit 1 after a retried transient provider error (open) | https://github.com/anomalyco/opencode/issues/50062 | 2026-10-14 | — |
2424
| Compaction internals emitted as `text` events (open) | https://github.com/anomalyco/opencode/issues/42238 | 2026-10-14 | — |
2525
| `run --agent` does not fail closed on unknown names (open) | https://github.com/anomalyco/opencode/issues/47038 | 2026-10-14 | — |

0 commit comments

Comments
 (0)