Skip to content

fix(tools): return Err(ToolError::Timeout) from ShellExecutor on timeout#1446

Merged
bug-ops merged 3 commits intomainfrom
shell-timeout-tool-error
Mar 9, 2026
Merged

fix(tools): return Err(ToolError::Timeout) from ShellExecutor on timeout#1446
bug-ops merged 3 commits intomainfrom
shell-timeout-tool-error

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Mar 9, 2026

Summary

  • 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
  • Fixed by detecting the "[error] command timed out" sentinel in execute_inner() and returning Err(ToolError::Timeout { timeout_secs }) before the output is wrapped
  • Corrected AuditResult classification order so timeout messages are logged as Timeout, not Error

Test plan

  • Updated timeout_enforced test: asserts Err(ToolError::Timeout { timeout_secs: 1 }) instead of Ok(...) with string matching
  • Added timeout_logged_as_audit_timeout_not_error: verifies AuditResult::Timeout is written to audit log (not AuditResult::Error)
  • Existing error_kind_timeout_is_transient in executor.rs confirms the retry path is activated
  • 4870 tests passed, 11 skipped

Closes #1420

bug-ops added 2 commits March 9, 2026 15:05
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
@github-actions github-actions bot added bug Something isn't working size/M Medium PR (51-200 lines) documentation Improvements or additions to documentation rust Rust code changes and removed size/M Medium PR (51-200 lines) labels Mar 9, 2026
@github-actions github-actions bot added the size/M Medium PR (51-200 lines) label Mar 9, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 9, 2026 14:37
@bug-ops bug-ops merged commit a0e767a into main Mar 9, 2026
18 checks passed
@bug-ops bug-ops deleted the shell-timeout-tool-error branch March 9, 2026 14:48
@bug-ops bug-ops mentioned this pull request Mar 9, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shell timeout bypasses ToolError::Timeout, retry never fires

1 participant