-
Notifications
You must be signed in to change notification settings - Fork 2
bug(tools): ServerError suggestion says 'retry automatically' but retryable=false in LLM feedback #2222
Description
Description
After PR #2214, the [tool_error] feedback shown to the LLM for HTTP 5xx errors has contradictory content:
[tool_error]
category: server_error
error: 503 Service Unavailable
suggestion: Server error. The system will retry automatically.
retryable: false
The suggestion says "The system will retry automatically" but retryable: false tells the LLM no automatic retry will occur. This contradicts itself and may cause the LLM to wait for a retry that never comes, or make incorrect recovery decisions.
Reproduction
Session with [tools.retry] max_attempts = 2 (default). Prompt: Fetch https://httpbin.org/status/503. Observed in CI-207 live test (debug dump: 0001-tool-error-fetch.json).
Root Cause
ToolErrorFeedback.retryable is hardcoded to false in the final conversion loop (native.rs:1422). The suggestion text is taken from category.suggestion() which returns the pre-retry string ("retry automatically") regardless of whether retries were attempted or exhausted.
Fix Direction
Two options:
- Update
ToolErrorCategory::ServerError.suggestion()to a generic message ("may be temporary") and let theretryablefield communicate retry intent - Set
retryable: truein the feedback for errors that Phase 2 will retry (before retry fires), andretryable: falseafter exhaustion
Option 1 is simpler and avoids state tracking.