fix(v1): end the Bash chat program cleanly on context overflow when it cannot compact - #2633
Merged
Merged
Conversation
parkerpettit
force-pushed
the
fix/bash-overflow-without-compaction
branch
from
September 19, 2026 16:44
06a76cd to
63cc520
Compare
parkerpettit
marked this pull request as ready for review
September 19, 2026 16:59
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This one-file fix cleanly distinguishes unavailable compaction from failed compaction, preserving partial transcripts when no threshold exists while still surfacing genuine compaction failures. The change is small, localized, and does not introduce broader API or infrastructure risk. You can add or adjust custom eligibility rules. Learn more. |
…t cannot compact The bundled chat program re-raised a context-overflow 400 whenever it ran as the Bash harness, on the assumption that Bash compacts. With compaction disabled the Compactor re-raises the overflow untouched, so a Bash rollout that ran out of context crashed with exit 1 and was recorded as a retryable error instead of ending with the transcript so far, as the Null program does. The same happened with compaction enabled but no threshold (none given and none discoverable from the provider's model card): the compactor never acts in that state. Gate the re-raise on whether the compactor can act (enabled with a threshold) rather than on the harness: when it cannot, overflow ends the run cleanly for both programs; when it can, an overflow that reaches the loop is a real failure and still propagates (CompactionFailed included).
parkerpettit
force-pushed
the
fix/bash-overflow-without-compaction
branch
from
September 19, 2026 17:14
63cc520 to
bc4f235
Compare
mikasenghaas
approved these changes
Sep 19, 2026
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.
The bundled chat program re-raises a context-overflow 400 whenever it runs as the Bash harness, on the assumption that Bash compacts. With compaction disabled the
Compactorre-raises the overflow untouched, so a Bash rollout that runs out of context exits 1 and is recorded asstop=ProviderError(and retried, ifProviderErroris in the retry list) instead of ending with the transcript so far like the Null program does. The same happens with compaction enabled but no threshold, i.e. none given and none discoverable from the provider's model card: the compactor never acts in that state.Gate the re-raise on whether the compactor can act (
enabledwith athreshold) instead of onargs.bash. When it can, nothing changes: an overflow that reaches the loop is still a real failure, andCompactionFailedstill propagates (#2584). No other harness ships this program (browser_use bundles its own).Checked through the real rollout (interception server, subprocess runtime, scoring) against a scripted fake OpenAI server: Bash without compaction, and Bash with compaction but no discoverable window, now end
okand scored on overflow, like Null; Bash with a threshold still recovers from a mid-run overflow; a rebuilt conversation that still overflows and an unrelated 400 both still fail the rollout.Note
Fix
run_chat_loopcontext overflow handling based on compaction stateargs.bashspecial-casing for API errors in therun_chat_loopconversation loop.Macroscope summarized bc4f235.