fix(tools): repair Phase 2 transient retry and fix retryable feedback (#2223, #2222)#2245
Merged
fix(tools): repair Phase 2 transient retry and fix retryable feedback (#2223, #2222)#2245
Conversation
…#2223, #2222) - TrustGateExecutor was missing is_tool_retryable() delegation to its inner executor; the default false caused Phase 2 retry to never fire for fetch/HTTP tools returning 503 (#2223) - ToolErrorFeedback.retryable was hardcoded false; now uses category.is_retryable() so transient errors (ServerError, NetworkError, RateLimited, Timeout) correctly report retryable: true (#2222) - Suggestion text for transient categories changed from "The system will retry automatically." to "The system will retry if possible." to avoid contradicting the retryable field state at exhaustion (#2222) Closes #2223, closes #2222
f074b94 to
05195cb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TrustGateExecutorwas missingis_tool_retryable()delegation — the defaultfalsecaused Phase 2 retry to never fire for HTTP-based tools (fetch,web_scrape) even on 503 responses. Fixed by delegating to the inner executor, mirroring thePolicyGateExecutorpattern.ToolErrorFeedback.retryablewas hardcodedfalsefor all errors. Now usescategory.is_retryable()so transient categories correctly reportretryable: true. Suggestion text changed from "The system will retry automatically." to "The system will retry if possible." to avoid contradicting theretryablefield state when retries are exhausted.Changes
crates/zeph-tools/src/trust_gate.rs— addedis_tool_retryabledelegationcrates/zeph-core/src/agent/tool_execution/native.rs—retryable: false→category.is_retryable()crates/zeph-tools/src/error_taxonomy.rs— neutral suggestion text for transient categories + new testscrates/zeph-tools/src/executor.rs— new testtool_error_http_503_is_transient_triggers_phase2_retryTest plan
is_tool_retryable_delegated_to_inner— verifies delegation through TrustGateExecutor for both true/false casesfeedback_retryable_matches_category_is_retryable— transient (ServerError/NetworkError/RateLimited/Timeout → true) and permanent (InvalidParameters/PolicyBlocked/PermanentFailure → false)transient_suggestion_neutral_no_automatically— verifies no "automatically" in suggestion texttool_error_http_503_is_transient_triggers_phase2_retry— end-to-end: Http{503} → ServerError → is_retryable()=true → Phase 2 firesCloses #2223
Closes #2222