fix(parser): detect opencode invalid tool calls as failures - #1255
Merged
mjacobs merged 4 commits intoJul 24, 2026
Merged
Conversation
Opencode stores failed tool calls as type:'tool' with tool:'invalid' and state.status:'completed' — the existing parser never emitted a ResultEvent, so ComputeToolHealth had no error signal to detect. When tool == 'invalid', attach a ResultEvent with Status:'errored' so extractToolCallRows → signals.IsFailure → ComputeToolHealth counts it as a failure signal. Fixes kenn-io#1254
roborev: Combined Review (
|
Previously synced OpenCode sessions were parsed before the invalid-tool failure fix and carry no errored result events. Bumping the data version triggers the non-destructive resync so historical invalid calls count as failures.
roborev: Combined Review (
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1254
Problem
Opencode stores failed tool calls with
tool: "invalid"andstate.status: "completed"— the parser never emitted aResultEvent, soComputeToolHealthhad no error signal to detect. All opencode sessions showedtool_failure_signal_count: 0despite confirmed invalid tool calls.Fix
In
extractOpenCodeToolCall(), whend.ToolName == "invalid", attach aResultEvent{Status: "errored"}so the signal pipeline (extractToolCallRows→signals.IsFailure→ComputeToolHealth) counts it as a failure.Test
Added
TestParseOpenCodeDB_InvalidToolCallthat seeds a session with an invalid tool part and assertsResultEvents[0].Status == "errored".All existing opencode tests continue to pass.