-
Notifications
You must be signed in to change notification settings - Fork 2.9k
fix(reliability): bound empty assistant output retries #11391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.