mpfaffenberger / mpfaffenberger/code_puppy
Hidden 270s absolute timeout overrides caller's timeout arg in run_shell_command; error message reports wrong limit
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 814
- Forks
- 278
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 76
Description
File: code_puppy/tools/command_runner.py - run_shell_command_streaming (~line 697)
Severity: Medium (surprising behavior)
ABSOLUTE_TIMEOUT_SECONDS = 270
Every foreground shell command is hard-killed after 270 seconds, regardless of the timeout parameter the agent passed. The timeout arg only controls the inactivity timeout; the absolute cap is a hidden module constant that:
- is not mentioned in the
agent_run_shell_commandtool docstring (which advertisestimeout: int = 60as if it were the only knob), so the model reasonably believestimeout=600buys 10 minutes; - kills legitimately long, actively-printing jobs (test suites, builds, downloads) at 4.5 minutes even though they're producing output;
- returns
exit_code=-9, timeout=True, error="Command timed out after {timeout} seconds"- which reports the inactivity number, not the 270s that actually triggered, so the message lies about what happened (cleanup_process_and_threads receivestimeout_typebut doesn't use it in the error string).
Explicit is better than implicit. Suggested fix:
- Make the absolute cap configurable (config key or parameter), or derive it from the caller's timeout (e.g.
max(270, timeout * N)). - Include the actual limit and timeout type in the returned
errorstring:f"Command killed by {timeout_type} timeout after {limit}s". - Document both timeouts in the tool docstring so the model can choose
background=Truefor long jobs instead of being mystery-killed.
Filed by Zen Reviewer B (code-puppy-60635a)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in code_puppy/tools/command_runner.py at run_shell_command_streaming around line 697, then follow cleanup_process_and_threads and the agent_run_shell_command tool docstring. Trace how the inactivity and absolute timeouts are selected and reported. Done means the cap behavior is explicit or configurable, the error identifies the actual timeout type and limit, and both timeouts are documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100