Skip to content

Replay exec-server shell snapshots through unnamed files - #48078

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/8103d5c37ce4d1885628a4efba3551549f12bea8
Sep 25, 2026
Merged

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

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Replay exec-server shell snapshots through unnamed files

Why

Large shell snapshots need a replay path that does not add their state to the child process environment.

What changed

  • Keep captured state cached in memory and give each Bash or Zsh launch an independent, read-only file descriptor to source. Unlink the file before writing shell state, create it under the sandbox-protected daemon directory, and close the carrier descriptor before restoring functions.
  • Probe descriptor-path access inside the capture sandbox. Retain environment replay for sh and when descriptor paths are unavailable; use normal shell startup if preparing the replay file fails.
  • Group options and aliases during capture so sourcing preserves their parsing behavior.

Testing

Add coverage for concurrent replays with 480 KiB payloads, pipe and TTY execution, stdin preservation, descriptor cleanup, sandbox protection, blocked descriptor-path fallback, and alias/option parsing equivalence.

## Why

Large shell snapshots need a replay path that does not add their state to the child process environment.

## What changed

- Keep captured state cached in memory and give each Bash or Zsh launch an independent, read-only file descriptor to source. Unlink the file before writing shell state, create it under the sandbox-protected daemon directory, and close the carrier descriptor before restoring functions.
- Probe descriptor-path access inside the capture sandbox. Retain environment replay for `sh` and when descriptor paths are unavailable; use normal shell startup if preparing the replay file fails.
- Group options and aliases during capture so sourcing preserves their parsing behavior.

## Testing

Add coverage for concurrent replays with 480 KiB payloads, pipe and TTY execution, stdin preservation, descriptor cleanup, sandbox protection, blocked descriptor-path fallback, and alias/option parsing equivalence.

GitOrigin-RevId: 8103d5c37ce4d1885628a4efba3551549f12bea8
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/8103d5c37ce4d1885628a4efba3551549f12bea8 branch from 2481338 to c98e263 Compare September 25, 2026 12:23
@copyberry
copyberry Bot merged commit c98e263 into main Sep 25, 2026
1 check passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/8103d5c37ce4d1885628a4efba3551549f12bea8 branch September 25, 2026 12:23
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 25, 2026
@vyzo
vyzo deployed to issue-triage September 25, 2026 12:45 — with GitHub Actions Active
@vyzo
vyzo deployed to issue-triage September 25, 2026 12:45 — with GitHub Actions Active
@vyzo
vyzo deployed to issue-triage September 25, 2026 12:45 — with GitHub Actions Active
@kmotohas
kmotohas deployed to issue-triage September 25, 2026 13:03 — with GitHub Actions Active
@kmotohas
kmotohas deployed to issue-triage September 25, 2026 13:03 — with GitHub Actions Active
@kmotohas
kmotohas deployed to issue-triage September 25, 2026 13:03 — with GitHub Actions Active
@kmotohas
kmotohas deployed to issue-triage September 25, 2026 13:05 — with GitHub Actions Active
@wjz2001
wjz2001 deployed to issue-triage September 25, 2026 13:07 — with GitHub Actions Active
@carcer
carcer deployed to issue-triage September 25, 2026 14:00 — with GitHub Actions Active
@carcer
carcer deployed to issue-triage September 25, 2026 14:00 — with GitHub Actions Active
@carcer
carcer deployed to issue-triage September 25, 2026 14:00 — with GitHub Actions Active
@Xpycode
Xpycode deployed to issue-triage September 25, 2026 14:01 — with GitHub Actions Active
@Xpycode
Xpycode deployed to issue-triage September 25, 2026 14:01 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
issue-triage — c98e263f Deployed Sep 25, 2026 by carcer via Identify potential duplicates (open issues fallback) #48259
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.