Skip to content

bug(tools): ServerError suggestion says 'retry automatically' but retryable=false in LLM feedback #2222

@bug-ops

Description

@bug-ops

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:

  1. Update ToolErrorCategory::ServerError.suggestion() to a generic message ("may be temporary") and let the retryable field communicate retry intent
  2. Set retryable: true in the feedback for errors that Phase 2 will retry (before retry fires), and retryable: false after exhaustion
    Option 1 is simpler and avoids state tracking.

Metadata

Metadata

Assignees

Labels

P2High value, medium complexitybugSomething isn't workingllmzeph-llm crate (Ollama, Claude)

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions