Skip to content

Clean up process groups for failed shell snapshot captures - #49782

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

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

Conversation

@copyberry

@copyberry copyberry Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Clean up process groups for failed shell snapshot captures

Why

Failed shell snapshot captures could leave processes launched by shell startup files running after the capture ended.

What changed

Run each Unix shell snapshot capture in its own process group and kill that group on failure, timeout, or cancellation. Keep the capture leader unreaped until output and exit status are validated so its process group ID cannot be reused during cleanup. Preserve startup helpers after a successful capture.

Testing

Add regression coverage for startup child cleanup after nonzero exits, invalid output, cancellation, and timeout, alongside fallback and retry behavior. Verify that successful captures preserve delayed startup output and background services and reuse the cached snapshot.

## Why

Failed shell snapshot captures could leave processes launched by shell startup files running after the capture ended.

## What changed

Run each Unix shell snapshot capture in its own process group and kill that group on failure, timeout, or cancellation. Keep the capture leader unreaped until output and exit status are validated so its process group ID cannot be reused during cleanup. Preserve startup helpers after a successful capture.

## Testing

Add regression coverage for startup child cleanup after nonzero exits, invalid output, cancellation, and timeout, alongside fallback and retry behavior. Verify that successful captures preserve delayed startup output and background services and reuse the cached snapshot.

GitOrigin-RevId: a56ef5d8615325952bdc8bb78727de1559e7e9c7
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/a56ef5d8615325952bdc8bb78727de1559e7e9c7 branch from d217ec6 to 1a91349 Compare October 1, 2026 00:48
@copyberry
copyberry Bot merged commit 1a91349 into main Oct 1, 2026
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/a56ef5d8615325952bdc8bb78727de1559e7e9c7 branch October 1, 2026 00:48
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 1, 2026
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.

1 participant