Skip to content

fix: add a timeout to bash execution#5

Open
Gujiassh wants to merge 1 commit intosanbuphy:mainfrom
Gujiassh:fix/bash-timeout-agent
Open

fix: add a timeout to bash execution#5
Gujiassh wants to merge 1 commit intosanbuphy:mainfrom
Gujiassh:fix/bash-timeout-agent

Conversation

@Gujiassh
Copy link
Contributor

Summary

  • add a 30-second timeout to agent.py's execute_bash() path so the main CLI no longer hangs forever on blocking shell commands
  • return a deterministic timeout error string when the subprocess expires
  • add focused regression tests that assert the timeout parameter is forwarded and timeout errors are surfaced cleanly

Validation

  • python3 -m unittest tests.test_agent.AgentRegressionTests.test_execute_bash_passes_timeout tests.test_agent.AgentRegressionTests.test_execute_bash_returns_timeout_error

Notes

  • the broader tests/test_agent.py suite still contains pre-existing failures around parse_tool_arguments on agent.py, which belong to the already-open tool-call guardrail line in #4; this PR intentionally stays scoped to bash timeout hardening only

Prevent the main nanoAgent entrypoint from hanging forever on blocking shell commands by enforcing the same 30s timeout already used in the richer agent variants.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant