Skip to content

Prewarm shell snapshots for eligible turns - #42137

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

Prewarm shell snapshots for eligible turns#42137
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/ff24a4f0328c06653e09d03fd0a3db1eccd65030

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 1, 2026

Copy link
Copy Markdown

Prewarm shell snapshots for eligible turns

Why

Shell Snapshot V2 previously captured the login-shell environment lazily when a
command started, adding that work to the command path.

What changed

  • Start one asynchronous snapshot capture after turn hooks accept the turn, so
    eligible local exec_command calls can reuse it without blocking the model.
  • Use the turn's resolved tools, permissions, sandbox, environment, and shell
    configuration, and skip prewarming for unsupported or network-managed cases.
  • Cancel outstanding prewarming during shutdown. Keep failed speculative
    captures retryable by real commands without consuming their retry budget.

Testing

Added coverage for non-blocking capture and reuse, failure recovery, sandbox and
permission isolation, shutdown cancellation, hook-stopped turns, eligibility
gates, and concurrent capture retries.

## Why

Shell Snapshot V2 previously captured the login-shell environment lazily when a
command started, adding that work to the command path.

## What changed

- Start one asynchronous snapshot capture after turn hooks accept the turn, so
  eligible local `exec_command` calls can reuse it without blocking the model.
- Use the turn's resolved tools, permissions, sandbox, environment, and shell
  configuration, and skip prewarming for unsupported or network-managed cases.
- Cancel outstanding prewarming during shutdown. Keep failed speculative
  captures retryable by real commands without consuming their retry budget.

## Testing

Added coverage for non-blocking capture and reuse, failure recovery, sandbox and
permission isolation, shutdown cancellation, hook-stopped turns, eligibility
gates, and concurrent capture retries.

GitOrigin-RevId: ff24a4f0328c06653e09d03fd0a3db1eccd65030
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/ff24a4f0328c06653e09d03fd0a3db1eccd65030 branch from ba3c613 to 612e649 Compare September 1, 2026 21:17
@copyberry
copyberry Bot merged commit 612e649 into main Sep 1, 2026
24 of 32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/ff24a4f0328c06653e09d03fd0a3db1eccd65030 branch September 1, 2026 21:18
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 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.

3 participants