fix(tools): return Err(ToolError::Timeout) from ShellExecutor on timeout#1446
Merged
fix(tools): return Err(ToolError::Timeout) from ShellExecutor on timeout#1446
Conversation
Shell command timeouts were silently wrapped in Ok(ToolOutput) with an
error string, bypassing ToolError::Timeout and making max_tool_retries
ineffective for timed-out commands.
Fix: detect the "[error] command timed out" sentinel in execute_inner()
and return Err(ToolError::Timeout { timeout_secs }) before the output
is wrapped. AuditResult classification order corrected so timeout
messages are logged as Timeout, not Error.
Closes #1420
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
Ok(ToolOutput)with an error string, bypassingToolError::Timeoutand makingmax_tool_retriesineffective for timed-out commands"[error] command timed out"sentinel inexecute_inner()and returningErr(ToolError::Timeout { timeout_secs })before the output is wrappedAuditResultclassification order so timeout messages are logged asTimeout, notErrorTest plan
timeout_enforcedtest: assertsErr(ToolError::Timeout { timeout_secs: 1 })instead ofOk(...)with string matchingtimeout_logged_as_audit_timeout_not_error: verifiesAuditResult::Timeoutis written to audit log (notAuditResult::Error)error_kind_timeout_is_transientinexecutor.rsconfirms the retry path is activatedCloses #1420