Allow disabling wrapper timeout#2
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cf7dd2634b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if timeout_sec <= 0: | ||
| return False | ||
| current = time.time() if now is None else now | ||
| return current - start >= timeout_sec |
There was a problem hiding this comment.
Reject NaN timeout values before disabling timeout
argparse accepts --timeout-sec nan as a float, and with this helper that value never expires: timeout_sec <= 0 is false for NaN and current - start >= timeout_sec is also always false, so run_tui can wait indefinitely unless another exit path happens. This is a regression from the prior loop condition (which did not continue when timeout was NaN) and can surprise callers who accidentally pass invalid numeric input.
Useful? React with 👍 / 👎.
Summary
--timeout-sec 0as disabling theclaude-pwrapper timeout for long-running promptsMotivation
Some Claude Code tasks legitimately run longer than a fixed wrapper timeout. Users can already manage timeouts outside
claude-pwith their shell, CI runner, or SDK caller, so--timeout-sec 0should let the wrapper wait indefinitely while Claude Code continues to run normally.Example usage:
claude-p "Run a long local task and summarize the result" --timeout-sec 0Validation
uv run --with pytest pytest tests -q-> 12 passeduv build-> builtdist/claude_p-0.1.4.tar.gzanddist/claude_p-0.1.4-py3-none-any.whluvx twine check dist/*-> PASSED