You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(parser): detect opencode invalid tool calls as failures (#1255)
Fixes#1254
## Problem
Opencode stores failed tool calls with `tool: "invalid"` and `state.status: "completed"` — the parser never emitted a `ResultEvent`, so `ComputeToolHealth` had no error signal to detect. All opencode sessions showed `tool_failure_signal_count: 0` despite confirmed invalid tool calls.
## Fix
In `extractOpenCodeToolCall()`, when `d.ToolName == "invalid"`, attach a `ResultEvent{Status: "errored"}` so the signal pipeline (`extractToolCallRows` → `signals.IsFailure` → `ComputeToolHealth`) counts it as a failure.
## Test
Added `TestParseOpenCodeDB_InvalidToolCall` that seeds a session with an invalid tool part and asserts `ResultEvents[0].Status == "errored"`.
All existing opencode tests continue to pass.
Co-authored-by: ajinkyajacob <ajinkyajacob@users.noreply.github.com>
0 commit comments