Skip to content

fix(sandbox): add opt-in bounded workspace outbox reads - #5128

Merged
seratch merged 4 commits into
mainfrom
fix/append-workspace-jsonl
Sep 25, 2026
Merged

seratch merged 4 commits into
mainfrom
fix/append-workspace-jsonl

Conversation

@seratch

@seratch seratch commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

This pull request adds opt-in bounded reads for workspace event logs while preserving unlimited delivery by default.

Summary

  • Add read_bounded() to sandbox sessions and provider adapters so callers can limit how much file content is acquired. Custom backends inherit a compatible fallback; acquisition inside their existing read() implementation is outside the limit.
  • Add an optional WorkspaceJsonlSink(max_bytes=...) budget for the replacement file and pending buffer. Exceeding a finite budget reports one error and permanently stops that sink; it never truncates the existing log. The default None retains released whole-file reads and unlimited delivery.
  • Use Modal's 100 MiB per-request ceiling to avoid one remote operation per 64 KiB, and preserve Daytona timeout retryability while sanitizing provider errors and closing acquired responses.

The sink still reads and replaces the outbox. Workspace logs remain workload-modifiable and are not authoritative audit records; host-file and HTTP sinks remain the alternatives for external logging. Documentation for the new option should ship separately when the behavior is released.

Test plan

  • Focused bounded-read and sink regressions: 130 passed, 9 native macOS sandbox tests skipped under Codex.
  • Full repository verification: formatting, lint, mypy, pyright, parallel tests, and serial tests passed.
  • Two independent reviews of the complete PR diff passed, covering released compatibility, provider acquisition and cleanup, and sensitive errors.
  • Native macOS sandbox coverage remains enabled in CI.

Checks

  • Added regression tests
  • Ran .agents/skills/code-change-verification/scripts/run.sh
  • Confirmed all local verification steps pass
  • Completed independent code review before submission

@seratch seratch added this to the 0.22.x milestone Sep 21, 2026
@seratch
seratch requested review from a team and rm-openai as code owners September 21, 2026 02:40
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-25T21:45:51.762604Z d54ab6f New commits
🔒 Security Review ✅ Completed 2026-09-25T21:45:40.244887Z d54ab6f New commits

Security findings

Advisory findings (2)

ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d79c7cb802

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/sandbox/session/sinks.py Outdated
Comment thread src/agents/sandbox/session/sinks.py Outdated
@seratch
seratch force-pushed the fix/append-workspace-jsonl branch from d79c7cb to 51e3a9f Compare September 21, 2026 05:55
Comment thread tests/sandbox/test_session_sinks.py Fixed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 51e3a9f2d7

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/sandbox/session/sinks.py Outdated
Comment thread src/agents/sandbox/session/sinks.py Outdated
Comment thread src/agents/sandbox/session/sinks.py Outdated
@seratch
seratch force-pushed the fix/append-workspace-jsonl branch from 51e3a9f to 7efea27 Compare September 21, 2026 06:41

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7efea27015

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/sandbox/sandboxes/unix_local.py Outdated
Comment thread src/agents/sandbox/session/sinks.py Outdated
@seratch
seratch force-pushed the fix/append-workspace-jsonl branch from 7efea27 to 6772d45 Compare September 21, 2026 07:38
Comment thread tests/sandbox/test_unix_local.py Fixed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6772d451f6

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/sandbox/session/sinks.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: 6772d451f6

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread src/agents/sandbox/session/sinks.py Outdated
@seratch
seratch force-pushed the fix/append-workspace-jsonl branch from 6772d45 to b354c16 Compare September 21, 2026 08:23

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b354c16d5e

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/sandbox/session/sinks.py Outdated
@seratch
seratch force-pushed the fix/append-workspace-jsonl branch from b354c16 to 7dd2e5a Compare September 21, 2026 09:46

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7dd2e5ae6b

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/sandbox/session/sinks.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: 7dd2e5ae6b

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread src/agents/sandbox/session/sinks.py Outdated
@seratch
seratch force-pushed the fix/append-workspace-jsonl branch from 7dd2e5a to 742bda5 Compare September 21, 2026 12:02
Comment thread src/agents/sandbox/session/sinks.py Fixed
Comment thread tests/sandbox/test_unix_local.py Fixed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 742bda5ca4

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/sandbox/session/sinks.py Outdated
Comment thread src/agents/sandbox/session/sinks.py Outdated
Comment thread src/agents/sandbox/session/sinks.py Outdated
@seratch
seratch force-pushed the fix/append-workspace-jsonl branch from 742bda5 to d1db1cd Compare September 21, 2026 22:04
Comment thread tests/sandbox/test_bounded_read.py Dismissed
Comment thread tests/sandbox/test_bounded_read.py Fixed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d1db1cd84c

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/sandbox/session/base_sandbox_session.py Outdated
@seratch
seratch force-pushed the fix/append-workspace-jsonl branch from d1db1cd to 22e4863 Compare September 21, 2026 23:14

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 22e4863205

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/sandbox/session/base_sandbox_session.py Outdated
@seratch
seratch force-pushed the fix/append-workspace-jsonl branch from 22e4863 to 4013f8a Compare September 22, 2026 01:05

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4013f8a701

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/extensions/sandbox/daytona/sandbox.py Outdated
Comment thread src/agents/sandbox/session/sinks.py Outdated
Comment thread src/agents/extensions/sandbox/vercel/sandbox.py Outdated
@seratch
seratch force-pushed the fix/append-workspace-jsonl branch from 4013f8a to b5f87b8 Compare September 22, 2026 02:05
Comment thread tests/sandbox/test_bounded_read.py Dismissed
Comment thread tests/sandbox/test_bounded_read.py Dismissed
Comment thread tests/sandbox/test_bounded_read.py Dismissed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b5f87b888d

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/extensions/sandbox/e2b/sandbox.py
Comment thread src/agents/extensions/sandbox/blaxel/sandbox.py Outdated
@seratch
seratch force-pushed the fix/append-workspace-jsonl branch from b5f87b8 to 75a561b Compare September 22, 2026 02:30
@seratch
seratch force-pushed the fix/append-workspace-jsonl branch from 75a561b to cd7b619 Compare September 22, 2026 15:07

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 102beadb42

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/extensions/sandbox/daytona/sandbox.py Outdated
Comment thread src/agents/extensions/sandbox/modal/sandbox.py Outdated
@jbeckwith-oai jbeckwith-oai changed the title fix(sandbox): append workspace events without rereading the outbox fix(sandbox): add opt-in bounded workspace outbox reads Sep 25, 2026
jbeckwith-oai
jbeckwith-oai previously approved these changes Sep 25, 2026

@jbeckwith-oai jbeckwith-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the complete diff at 91b4bc5. No actionable findings remain.

Checked released default compatibility, opt-in budget/exhaustion behavior, every bounded-read adapter and the legacy fallback, path handling, provider resource cleanup and cancellation, retryability, exception/event sanitization, and regression coverage. The unchanged final content also has two independent clean reviews and passing local formatting, lint, type checks, and full tests. All 22 CI checks are green, including native macOS and Windows; Windows Python 3.13 passed on retry after the first job timed out.

The documented finite-limit and custom-backend boundaries are clear, all review threads are resolved, and this is good to merge.

@markstuart-oai markstuart-oai left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 91b4bc50. The opt-in budget preserves the released unlimited default, and the provider retryability and cleanup changes address the earlier feedback. One structural issue remains in the test organization; please split the bounded workspace-sink coverage as noted inline.

Validation: source review of the complete change and relevant surrounding paths, including the v0.22.3 compatibility baseline. All 22 hosted checks pass on this commit. I did not run local tests or provider workloads.

Comment thread tests/sandbox/test_session_sinks.py Outdated
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Unknown error
ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d54ab6fec0

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/extensions/sandbox/modal/sandbox.py
@seratch
seratch merged commit 465860b into main Sep 25, 2026
22 checks passed
@seratch
seratch deleted the fix/append-workspace-jsonl branch September 25, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants