Skip to content

Allow disabling wrapper timeout#2

Open
alex-mextner wants to merge 1 commit into
Equality-Machine:devfrom
alex-mextner:feat/disable-wrapper-timeout
Open

Allow disabling wrapper timeout#2
alex-mextner wants to merge 1 commit into
Equality-Machine:devfrom
alex-mextner:feat/disable-wrapper-timeout

Conversation

@alex-mextner
Copy link
Copy Markdown

Summary

  • Treat --timeout-sec 0 as disabling the claude-p wrapper timeout for long-running prompts
  • Keep positive timeout behavior unchanged through a small timeout helper
  • Document the behavior in English and Chinese README usage sections

Motivation

Some Claude Code tasks legitimately run longer than a fixed wrapper timeout. Users can already manage timeouts outside claude-p with their shell, CI runner, or SDK caller, so --timeout-sec 0 should 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 0

Validation

  • uv run --with pytest pytest tests -q -> 12 passed
  • uv build -> built dist/claude_p-0.1.4.tar.gz and dist/claude_p-0.1.4-py3-none-any.whl
  • uvx twine check dist/* -> PASSED

@alex-mextner alex-mextner marked this pull request as ready for review May 22, 2026 13:40
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/claude_p/cli.py
Comment on lines +181 to +184
if timeout_sec <= 0:
return False
current = time.time() if now is None else now
return current - start >= timeout_sec
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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