Skip to content

Codex/sandbox command streaming - #128

Merged
Dingway98 merged 2 commits into
mainfrom
codex/sandbox-command-streaming
Sep 23, 2026
Merged

Dingway98 merged 2 commits into
mainfrom
codex/sandbox-command-streaming

Conversation

@Dingway98

@Dingway98 Dingway98 commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Changes

Validation

  • ruff check
  • pytest

Note

Medium Risk
Changes core sandbox exec/start wire protocol and timeout/error behavior; requires a streaming-capable receiver and can surface new failure modes if receiver and SDK versions are mismatched.

Overview
Sandbox command execution now streams output over SSE instead of blocking on /sandbox/exec or a non-streaming process start. exec() and processes.start() open a streaming POST /sandbox/processes, buffer stdout/stderr in the SDK (default 64 MiB via max_output_bytes), and support live stream(), disconnect(), and reattach semantics documented in the README.

Shared ProcessOutput validates sequenced events, enforces output limits (output_limit_exceeded / incomplete_output), and assembles final SandboxProcessResult including new output_truncated / last_seq fields. Sync and async transports gain POST SSE, a 60s read-idle timeout after headers (heartbeats reset it), streaming_not_supported when the receiver is too old (no automatic retry), and sync socket shutdown for clean disconnect.

Local wait(timeout_...) on an active collector raises TimeoutError / asyncio.TimeoutError while collection continues; reattached processes with truncated retained output fail on wait().

Reviewed by Cursor Bugbot for commit 0d5a2f1. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor 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.

Stale Bugbot comment from a previous run.

Comment thread hyperbrowser/models/sandbox.py
@Dingway98
Dingway98 force-pushed the codex/sandbox-command-streaming branch from 52adeba to 997f982 Compare September 22, 2026 23:57

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 997f982. Configure here.

@Dingway98
Dingway98 merged commit e614b08 into main Sep 23, 2026
13 checks passed
@Dingway98
Dingway98 deleted the codex/sandbox-command-streaming branch September 23, 2026 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants