Stream Bash/edit eval requests through long reasoning turns - #2566
Open
samsja wants to merge 3 commits into
Open
Stream Bash/edit eval requests through long reasoning turns#2566samsja wants to merge 3 commits into
samsja wants to merge 3 commits into
Conversation
samsja
marked this pull request as ready for review
September 8, 2026 19:59
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8627469. Configure here.
Restore assistant role metadata after SDK delta accumulation, reject empty streams before reading a snapshot, and pass --stream only to the bundled Bash/null program.
Contributor
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — The PR is a focused but cross-layer runtime transport change: shared chat calls switch to streamed completions, and training responses gain synthetic SSE framing while preserving full-response tool execution. Because existing request behavior changes across the harness and interception server, human review is appropriate. You can add or adjust custom eligibility rules. Learn more. |
xeophon
previously approved these changes
Sep 8, 2026
Remove the stream CLI and helper parameters and restore the shared launcher. Preserve training token generation through the normal commit path, framing its completed response as SSE for the harness.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Long Bash/edit reasoning turns can exceed the bundled client's read timeout while a healthy model is still generating. The shared Bash/null chat helper now always requests streaming, so model deltas and interception-server SSE keepalives reach the sandbox throughout the turn. There is no stream CLI flag, harness setting, or helper/compactor parameter; the shared launcher and compaction plumbing remain unchanged.
The SDK assembles complete responses before tools execute, preserving fragmented arguments, reasoning, usage, and
finish_reason="length". Assistant role metadata is normalized because some providers repeat it in each delta. Empty and unfinished streams fail before tool execution.Training clients continue generating complete responses through the normal graph-commit path, retaining token IDs and log probabilities. The interception server frames the completed training response as SSE for the harness; this does not add token-by-token generation to training. The chat dialect includes tool-call indexes when framing complete responses. Browser-use retains its existing launch arguments.
Validation:
This addresses idle request deadlines; it does not establish that all observed gateway 504s have the same cause.
Note
Medium Risk
Eval completion transport changes for bash/edit runs; truncated streams now raise
RuntimeErrorinstead of proceeding with partial output, though training paths remain non-streaming.Overview
Bash/edit eval harnesses can now use streaming chat completions so long model turns stay alive past idle read timeouts (e.g. 600s) via SSE keepalives, while the loop still waits for a full completion before running tools.
chat()gains an optionalstreamflag: when enabled it requestsstream_options.include_usage, accumulates chunks withAsyncChatCompletionStream(no auto tool-arg parsing), normalizes assistantrole, and fails if the stream ends without afinish_reason.Compactorforwards the same flag on initial, retry, and checkpoint-summary calls. The bundled program exposes--stream;launch_chat_programadds--streamonly for the shared null/bash program when the model context usesEvalClientConfig(training/non-eval clients keep non-streaming).Reviewed by Cursor Bugbot for commit c40ca9b. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add streaming mode for bash/edit eval completion requests in harness
streamkeyword option toCompactorthat is forwarded to initial, retry, and checkpoint-summary completion requests in compaction.pychathelper in core.py with a streaming path that requests usage data, collects the async stream, and returns the accumulated snapshot; raisesRuntimeErrorwhen the result has no choices or any choice lacks a finish reason--streamCLI flag toparse_argsand wires it into the standaloneCompactorsetup inmain--streamto generated program arguments in launch.py when the model context usesEvalClientConfig; other client configurations are unaffectedcore.chatraisesRuntimeErroron empty or unfinished choices — callers that previously tolerated such responses will now see failures📊 Macroscope summarized 8627469. 3 files reviewed, 2 issues evaluated, 0 issues filtered, 2 comments posted
🗂️ Filtered Issues