Skip to content

fix(sandbox): retain PTY output queued at timeout - #4572

Open
hsusul wants to merge 2 commits into
openai:mainfrom
hsusul:fix/pty-collector-final-drain
Open

fix(sandbox): retain PTY output queued at timeout#4572
hsusul wants to merge 2 commits into
openai:mainfrom
hsusul:fix/pty-collector-final-drain

Conversation

@hsusul

@hsusul hsusul commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • drain shared, E2B, Cloudflare, and Modal PTY collectors after deadline/timeout
  • preserve output queued between the final poll and timeout
  • add a deterministic regression test for timeout-tail output

Testing

  • python -m compileall -q on changed source and test files
  • focused pytest was attempted but this fresh worktree could not import the repository because optional dependency httpx2 was unavailable; dependency sync was blocked by package-index DNS failures

@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: e3359bb71c

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

@seratch seratch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you fix all the review comments?

@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: 08dd6d052c

ℹ️ 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 on lines +1068 to +1069
if task is None and not allow_new_read:
return b""

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep polling iterator-backed streams in the final probe

When the last regular poll consumes one ready async-iterator chunk, _read_modal_stream clears its task before the deadline check; if another chunk is already buffered, the final probe reaches this branch with task is None and skips it, so that output is still deferred until a later pty_write_stdin call. Keep blocking read() fallbacks disabled, but allow the final probe to start and zero-timeout-poll one __anext__() task for an existing iterator.

Useful? React with 👍 / 👎.

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.

2 participants