Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe change adds bounded process execution with concurrent output draining and process-tree termination, then applies it to Git push and pull-request creation commands with soft failure handling and timeout coverage. ChangesProcess timeout handling
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant push_and_open_pr
participant run_output_timeout
participant ChildProcess
participant kill_tree
push_and_open_pr->>run_output_timeout: run git push or gh pr create
run_output_timeout->>ChildProcess: spawn and drain output
run_output_timeout->>ChildProcess: poll until deadline
run_output_timeout->>kill_tree: terminate process tree on timeout
run_output_timeout-->>push_and_open_pr: return output or error
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/worktree.rs`:
- Around line 190-249: Update run_output_timeout to configure the spawned
Command with Stdio::null() for stdin, matching agent_launch::run_captured, while
preserving the existing piped stdout and stderr handling.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 23dde5df-a77d-4a87-a1fd-e2f4eeaa52c2
📒 Files selected for processing (2)
src/agent_launch.rssrc/worktree.rs
|
@coderabbitai review |
✅ Action performedReview finished.
|
git/gh were inheriting the MCP server's own stdin, which is the live JSON-RPC channel under stdio transport -- a credential prompt or any other stdin read in the child could consume or interfere with MCP traffic. Matches agent_launch::run_captured, which already nulls stdin for the same reason. Found by CodeRabbit on PR #181.
… timeout instead of abandoning it Previously the timed-out child was moved into a background thread that just blocked on wait_with_output() forever; the outer call returned on schedule but the process (and, more importantly, any grandchild like a stuck git credential helper) kept running unbounded. Now the child is placed in its own process group (Unix) and try_wait-polled with a deadline; on timeout the whole group is killed via the same kill_tree helper already used for headless agent runs, then reaped. Regression test spawns a command that outlives the timeout and would write a marker file if left running to completion, then asserts the marker never appears.
git/gh were inheriting the MCP server's own stdin, which is the live JSON-RPC channel under stdio transport -- a credential prompt or any other stdin read in the child could consume or interfere with MCP traffic. Matches agent_launch::run_captured, which already nulls stdin for the same reason. Found by CodeRabbit on PR #181.
Follow-up to item #45's review (subprocess timeout for push_and_open_pr, stacked on #180 / task/44 since both touch worktree.rs).
Found: run_output_timeout returned promptly on timeout but never killed the child — it moved the Child into a background thread that just blocked on wait_with_output() forever. The process (and any grandchild, e.g. a stuck git credential helper) kept running unbounded; a long-lived server would leak one thread + process per timeout.
Fixed by putting the child in its own process group (Unix) and try_wait-polling with a deadline; on timeout the whole group is killed via the existing kill_tree helper (already used for headless agent runs) and reaped, instead of just walking away. Stdout/stderr are drained on separate threads throughout so a chatty child can't deadlock the wait loop.
New regression test spawns a command that outlives the timeout and would write a marker file if left running to completion, then asserts the marker never appears — directly distinguishes "killed" from "abandoned but still running".
431/431 tests pass (was 430; +1), clippy clean (-D warnings -A unsafe_code -A clippy::pedantic), fmt clean.
Summary by CodeRabbit
Bug Fixes
Tests