Skip to content

fix(core): finish Windows shells without inherited-pipe waits - #45407

Closed
Hona wants to merge 4 commits into
anomalyco:v2from
Hona:shell-exit
Closed

Hona wants to merge 4 commits into
anomalyco:v2from
Hona:shell-exit

Conversation

@Hona

@Hona Hona commented Aug 26, 2026 •

Copy link
Copy Markdown
Member

Issue for this PR

Reported locally: bunx agent-browser printed its result but stayed pending because a descendant retained its output pipes.

Type of change

  • Bug fix

What does this PR do?

Add optional Windows-native stdout/stderr redirection through one append-only file handle. Foreground completion no longer waits for inherited output pipes. Positioned writes append, and truncation through the inherited handle is denied.

Keep the existing Shell pipe/drain lifecycle. Its writer appends rather than truncates, and pagination reads the actual file size. No generalized capture API, filesystem rewrite, or capture-mode state.

POSIX and workspace drivers keep pipes; their pre-existing retained-pipe hang is out of scope. Windows output handles are regular files rather than pipes, so descriptor detection and unsupported-operation error codes can differ. No post-exit timer is added. Independent of #45402.

How did you verify your code works?

  • 88 Windows tests passed, 53 platform skips; 53 Linux environment/spawner tests passed.
  • One real Shell integration test verifies prompt completion while the descendant remains alive, exact 1 MiB output plus stderr tail, positioned writes, and truncation protection.
  • Re-ran 485 comparison cases: no exit-status or redirected-file differences from baseline. All 249 Windows cases match the previous fixed revision byte-for-byte.
  • Real POSIX Shell.remove probe still kills the SIGTERM-ignoring child.
  • Core and Util typechecks passed.

Screenshots / recordings

Not applicable: process execution only.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Copilot AI lite review requested due to automatic review settings August 26, 2026 23:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Hona Hona changed the title fix(core): finish local shells without waiting on inherited pipes fix(core): finish Windows shells without inherited-pipe waits Aug 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants