Skip to content

Fix native Windows managed-process capture and cleanup - #146

Closed
Maximooch wants to merge 3 commits into
fix/process-subagent-reliabilityfrom
fix/windows-process-capture
Closed

Maximooch wants to merge 3 commits into
fix/process-subagent-reliabilityfrom
fix/windows-process-capture

Conversation

@Maximooch

@Maximooch Maximooch commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Native Windows managed processes now retain output and deliver completion reliably on Python 3.11/3.12. Capture no longer uses unavailable os.set_blocking or socket-only selectors on Windows pipes, and quiet polling uses high-resolution deadlines so clock granularity cannot cause extra scans.

Stacked on #133 (base 1ae80c50). Related to #124 and #126.

Changes

  • Launch native cmd.exe /d /s /c in a separate Windows process group.
  • Capture stdout/stderr independently using PeekNamedPipe and cancellable waits. Use perf_counter (QPC) for selector deadlines: Windows GetTickCount64-based monotonic clocks can advance only every 15.625ms, making a finished 20ms wait appear unfinished.
  • Keep the existing readiness-scan bound unchanged; add deterministic 20ms/60ms tests that reproduce the coarse-clock failure before the fix.
  • Apply build_tool_environment() to the system taskkill helper. Stop/timeout targets the local process tree; headless interrupt falls back to tree termination.
  • Report capture errors with bounded cleanup and emit completion only after an exit code exists.
  • Add native Windows Python 3.11/3.12 CI.

The managed-process portions were adapted from PR #125 at 4189a990. That PR is unchanged; its separate Python-execution and file-writing work is not included.

Validation

  • 19 native Windows tests passed locally on Python 3.11.14 with locked dependencies. The original quiet-process test also passed three repeat runs without loosening its bound.
  • Deterministic coarse-clock tests fail before the deadline change and pass afterward.
  • Covers delayed/replayed output, concurrent Unicode streams, nonzero exits, stdin backpressure, all stop modes, headless interruption, capture faults, descendant cleanup, quiet-wait bounds, and callbacks after process_start returns without consuming the model cursor.
  • Earlier validation also reproduced the missing-os.set_blocking failure on Python 3.11.9 and passed 94 Linux process/runtime tests.
  • All CI jobs passed at f90f5cc290e4393a3b09d18f4f840915b361f7a2, including native Windows 3.11/3.12, Linux/macOS process contracts, both Link-provider jobs, runtime, TUI, docs, and security checks. External CodeRabbit review was skipped.
  • Focused lint/format and git diff --check pass. No dependency or lockfile changes; no full-suite or installed-runtime claim.

ACP integration and limits

Branch: fix/windows-process-capture; head: f90f5cc290e4393a3b09d18f4f840915b361f7a2. If portability commit 7505ee73 and environment-policy follow-up ed037b00 are already integrated, take only the final timing commit.

ProcessTools.bind/execute and process-event payload APIs are unchanged. No ACP files were edited.

Cleanup is not Windows Job Object ownership: detached descendants or descendants whose launching shell already exited are not guaranteed recoverable. Stopping local SSH does not guarantee remote termination. Output is decoded as UTF-8. Nothing was merged, deployed, or substituted for a running Penguin process.

@vercel

vercel Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
penguin Ready Ready Preview Oct 28, 2026 6:34am UTC

@coderabbitai

coderabbitai Bot commented Oct 28, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Maximooch

Copy link
Copy Markdown
Owner Author

Integrated with preserved commit history through #161 (main commit abd8a66). Closing this stacked review after verifying its current head is an ancestor of main.

@Maximooch Maximooch closed this Oct 28, 2026

This branch was successfully deployed

1 active deployment
Preview — f90f5cc2 Deployed Oct 28, 2026 by vercel[bot]
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