Skip to content

Commit bbef7c8

Browse files
BobHermes Agent
andcommitted
feat(events): parse completion, completed tools and errors
Three facts the parser was throwing away, and the success assertion needs all three. `finished` and `finishReason` come from the terminal step_finish. Absence is NOT a successful run: opencode can exit 0 having dropped the tail of the stream (anomalyco/opencode#31435, #29866, #26855, fixed-direction PR #44933), so "finished" and "exited cleanly" are different questions and only the stream answers the first. `completedTools` counts only what actually completed. A tool reporting `state.status === "completed"` whose `state.metadata.exit` is non-zero is not in the list - believing the status field is how a failed build looks like a passing one, and this parser is the only place that can tell the difference. `errors` keeps the provider's own error instead of flattening it. `ref` is extracted because it is the join key to opencode's log file, which turns "agent exited 1: no detail" into a root-cause lookup. 379 tests, clean strict typecheck. Co-Authored-By: Hermes Agent <hermes@localhost>
1 parent a6c3f5a commit bbef7c8

3 files changed

Lines changed: 948 additions & 1 deletion

File tree

0 commit comments

Comments
 (0)