Skip to content

fix(ai): an answered question is not a failed tool call - #3184

Merged
abose merged 1 commit into
mainfrom
ai
Sep 7, 2026
Merged

fix(ai): an answered question is not a failed tool call#3184
abose merged 1 commit into
mainfrom
ai

Conversation

@abose

@abose abose commented Sep 7, 2026

Copy link
Copy Markdown
Member

A question the user had just answered showed a red "failed" badge. The cause is the transport: AskUserQuestion is answered by DENYING the tool call and handing the user's choice back as the denial reason (the PreToolUse hook), so the CLI reports it as an error result — and the panel paints any error result red. Two invisible consequences rode along: histEntry.failed was set, so restored history showed the failure too, and every question ever asked was counted as "toolErr" in metrics.

Fixed where node forwards the result rather than in the UI, so the badge, the history entry and the metric all agree. Node now keeps a tool_use id → tool name map beside the existing id → counter map and suppresses the error flag for AskUserQuestion, with a comment explaining that the deny is our transport and not a failure. Unanswered questions are covered too: cancelling or stopping the turn is not a failure either.

Verified in the desktop app on all three answer paths — clicking an option, typing into the card's own free-text box (the reported case), and cancelling via Stop: isError false, no badge, and the answer reaches the model.

Also registers the new "questions" suite with run_ai_test_suite and puts QF-1/QF-6 in the quick set so this cannot regress unnoticed.

A question the user had just answered showed a red "failed" badge. The cause
is the transport: AskUserQuestion is answered by DENYING the tool call and
handing the user's choice back as the denial reason (the PreToolUse hook), so
the CLI reports it as an error result — and the panel paints any error result
red. Two invisible consequences rode along: histEntry.failed was set, so
restored history showed the failure too, and every question ever asked was
counted as "toolErr" in metrics.

Fixed where node forwards the result rather than in the UI, so the badge, the
history entry and the metric all agree. Node now keeps a tool_use id → tool
name map beside the existing id → counter map and suppresses the error flag
for AskUserQuestion, with a comment explaining that the deny is our transport
and not a failure. Unanswered questions are covered too: cancelling or
stopping the turn is not a failure either.

Verified in the desktop app on all three answer paths — clicking an option,
typing into the card's own free-text box (the reported case), and cancelling
via Stop: isError false, no badge, and the answer reaches the model.

Also registers the new "questions" suite with run_ai_test_suite and puts
QF-1/QF-6 in the quick set so this cannot regress unnoticed.
@sonarqubecloud

sonarqubecloud Bot commented Sep 7, 2026

Copy link
Copy Markdown

@abose
abose merged commit 3ec1045 into main Sep 7, 2026
15 of 21 checks passed
@abose
abose deleted the ai branch September 7, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant