fix(reliability): bound empty assistant output retries#11391
fix(reliability): bound empty assistant output retries#113910xMink wants to merge 3 commits intoRooCodeInc:mainfrom
Conversation
Route repeated empty assistant outputs (no text, no tool calls) into existing mistake-limit handling. Previously the empty-response path incremented consecutiveNoAssistantMessagesCount but never consecutiveMistakeCount, allowing unbounded auto-retry under auto-approval. Extract onEmptyAssistantOutput() and onNoToolUse() helpers to keep retry accounting consistent and testable.
All previously flagged issues have been addressed. No new issues found.
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
| private async onEmptyAssistantOutput(): Promise<void> { | ||
| this.consecutiveNoAssistantMessagesCount++ | ||
| if (this.consecutiveNoAssistantMessagesCount >= 2) { | ||
| await this.say("error", "MODEL_NO_ASSISTANT_MESSAGES") | ||
| this.consecutiveMistakeCount++ | ||
| } | ||
| } |
There was a problem hiding this comment.
Now that this path also increments consecutiveMistakeCount, the ConsecutiveMistakeError at line ~2732 will report "no_tools_used" as the reason even when the limit was reached via repeated empty assistant outputs. The comment at lines 2723-2724 ("The reason is 'no_tools_used' because this limit is reached via initiateTaskLoop") is also stale. Low severity since it only affects telemetry accuracy, but worth updating the reason to distinguish between the two error paths so dashboards/alerts can differentiate them.
Fix it with Roo Code or mention @roomote and request a fix.
Record which failure path triggered the mistake count increment (no_tools_used vs no_assistant_messages) instead of hardcoding "no_tools_used" in ConsecutiveMistakeError telemetry.
|
Addressed in 51e9866. Telemetry now records the actual trigger ( |
The inline union on Task.consecutiveMistakeReason included "no_assistant_messages" but the canonical ConsecutiveMistakeReason type in @roo-code/types did not, causing TS2345 compile failure. - Add "no_assistant_messages" to the shared type - Import ConsecutiveMistakeReason in Task.ts instead of inline union
Refs #10322
Summary
MODEL_NO_ASSISTANT_MESSAGESand incrementconsecutiveMistakeCountonEmptyAssistantOutput()andonNoToolUse()helpers to keep retry accounting consistent and testableTest plan
pnpm exec vitest run core/task/__tests__/Task.spec.ts— 38 passed, 4 skippedpnpm exec vitest run core/task/__tests__/grace-retry-errors.spec.ts— 14 passed (3 new tests call production helpers via(task as any).onEmptyAssistantOutput()/onNoToolUse())Important
Integrates repeated empty assistant outputs into the mistake-limit mechanism and refactors for consistent retry handling in
Task, with new tests added.Task.MODEL_NO_ASSISTANT_MESSAGESand incrementsconsecutiveMistakeCountfrom the second consecutive empty output.onEmptyAssistantOutput()andonNoToolUse()inTaskfor consistent retry accounting.grace-retry-errors.spec.tsfor new behavior, includingonEmptyAssistantOutput()andonNoToolUse().This description was created by
for 15a40c4. You can customize this summary. It will automatically update as commits are pushed.