fix: Use cryptographic randomness for sandbox PTY IDs - #1929
jbeckwith-oai wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 9a3c47e The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
markstuart-oai
left a comment
There was a problem hiding this comment.
Need status: plausible but unproven. I left an inline request for the supported outcome or contract that requires unpredictable session-local PTY routing IDs. The existing collision-checked registry already provides routing and separation; the evidence does not yet justify expanding its allocation and provider-failure behavior. I am withholding approval pending that rationale, without claiming a demonstrated security vulnerability.
The implementation review found no introduced correctness or cleanup-ownership defect. Range mapping is unbiased, allocation precedes pruning, and failure cleanup captures only the new attempt's handle or socket. I traced E2B, Daytona, Blaxel and Cloudflare, including cleanup overlapping another registration or session teardown. Node-only randomness and UUIDs would be worse fits for the shared runtime boundary and numeric contract; retaining the current implementation remains the strongest alternative until the need is established.
All 12 hosted checks passed at this head. I inspected the Node 24 job: 6,936 tests across 227 files passed, including the changed PTY/provider suites, with build/type/lint checks. The patch changeset is present and its hosted validation passed. This was a desk review with independent review and existing hosted evidence; no local tests or live sandbox operations were run.
Summary
Use Web Crypto with unbiased range mapping for sandbox PTY process IDs, preserving the existing numeric range and collision handling. If allocation fails, retain existing registry entries and await cleanup of newly created E2B and Daytona PTYs before returning the original error.
Includes focused regression coverage and a patch changeset for
@openai/agents-extensions. The affected boundary is PTY registration and provider resource cleanup; maintainer security review is requested.Test plan
git diff --checkpassed.Checks