Skip to content

Finish remote exec cleanup when output streams remain open - #53331

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/8346e5ce446280915b6e2ffa362fcfd79280bfff
Oct 12, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/8346e5ce446280915b6e2ffa362fcfd79280bfff

Conversation

@copyberry

@copyberry copyberry Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Finish remote exec cleanup when output streams remain open

Why

A remote process can exit while its output stream remains open, leaving the exit watcher waiting and delaying ExecCommandEnd even after output collection finishes.

What changed

Cancel the process output token after final collection or polling, on one-shot cancellation, and after confirmed termination. This releases the exit watcher while allowing delayed output to be collected before the final poll completes.

Testing

Add remote process event tests for output streams that remain open at the collection deadline, during interruption, and during explicit termination. Assert that ExecCommandEnd preserves the exit code and aggregated output, background terminals are cleared, and interruption and termination require no extra process/read requests.

## Why

A remote process can exit while its output stream remains open, leaving the exit watcher waiting and delaying `ExecCommandEnd` even after output collection finishes.

## What changed

Cancel the process output token after final collection or polling, on one-shot cancellation, and after confirmed termination. This releases the exit watcher while allowing delayed output to be collected before the final poll completes.

## Testing

Add remote process event tests for output streams that remain open at the collection deadline, during interruption, and during explicit termination. Assert that `ExecCommandEnd` preserves the exit code and aggregated output, background terminals are cleared, and interruption and termination require no extra `process/read` requests.

GitOrigin-RevId: 8346e5ce446280915b6e2ffa362fcfd79280bfff
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/8346e5ce446280915b6e2ffa362fcfd79280bfff branch from f609328 to 7e9c061 Compare October 12, 2026 09:29
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-12T09:29:24.653129Z f609328 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@copyberry
copyberry Bot merged commit 7e9c061 into main Oct 12, 2026
36 of 70 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/8346e5ce446280915b6e2ffa362fcfd79280bfff branch October 12, 2026 09:29
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 12, 2026
@ZJT065437
ZJT065437 deployed to issue-triage October 12, 2026 09:34 — with Image GitHub Actions Active
@ZJT065437
ZJT065437 deployed to issue-triage October 12, 2026 09:34 — with Image GitHub Actions Active
@ZJT065437
ZJT065437 deployed to issue-triage October 12, 2026 09:34 — with Image GitHub Actions Active
@zttrobot
zttrobot deployed to issue-triage October 12, 2026 09:34 — with Image GitHub Actions Active
@zttrobot
zttrobot deployed to issue-triage October 12, 2026 09:34 — with Image GitHub Actions Active
@zttrobot
zttrobot deployed to issue-triage October 12, 2026 09:34 — with Image GitHub Actions Active
@adamzend
adamzend deployed to issue-triage October 12, 2026 09:37 — with Image GitHub Actions Active
@adamzend
adamzend deployed to issue-triage October 12, 2026 09:37 — with Image GitHub Actions Active
@adamzend
adamzend deployed to issue-triage October 12, 2026 09:37 — with Image GitHub Actions Active
@1127973521
1127973521 deployed to issue-triage October 12, 2026 09:43 — with Image GitHub Actions Active
@1127973521
1127973521 deployed to issue-triage October 12, 2026 09:43 — with Image GitHub Actions Active
@1127973521
1127973521 deployed to issue-triage October 12, 2026 09:43 — with Image GitHub Actions Active

This branch was successfully deployed

1 active deployment
issue-triage — 7e9c061c Deployed Oct 12, 2026 by CalvinChen-X via Translate non-English issue #19535
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants