Repository navigation
Conversation
…g polls (#2129, #2136) Session-loop regression guards for the two "dropped continuation" reports. The persisted records of the cited incidents show the v1 loop did not end either turn, so this adds no engine change: - #2129: both auto-compactions (10-27, 10-30) were provider overflows. The loop replayed the pending request 1 ms after the summary finished and answered it in the same loop. The "user resent the same message" seen in the model's reasoning was that engine replay, not the user. - #2136: the user's "you stopped" message arrived 3.5 min into a 7-min `sleep 420` bash poll. The tool returned at 23:06:21 and the loop went straight to the next step. No silent stop exists in that session. Tests (each fails under a mutation that reintroduces the reported symptom): - overflow -> compaction -> replayed request answered in the same loop - token-limit compaction mid-task -> turn continues past the summary - polling bash calls -> loop continues, picks up a message sent mid-poll Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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.
Summary
I investigated #2129 and #2136 against the persisted session records (message and part rows plus the engine log) of the exact incidents each issue cites. In neither incident did the v1 session loop end the turn. So this PR has no engine change. It adds three session-loop regression tests that lock in the behavior both issues ask for, and it records the findings. It is a draft because the reported root causes could not be confirmed. The record contradicts them.
Refs #2129, refs #2136 (this PR does not close them; see "Proposed disposition").
Findings
#2129: the auto-compaction turn did not end on the summary
Input is too long for requested model). Each has a compaction part withauto: true, overflow: true.SessionCompaction.processreplayed the pending user request. The replay message was created 1 ms (10-30) and 4 ms (10-27) after the summary message completed. The engine log shows the loop going straight to the next step with noexiting loop. The same loop then answered the request (10-30: three new figure versions, finishstopat 22:44:56).auto: false). By design they end on the summary.#2136: the polling turn did not end silently
sleep 420; …bash call with a 500 s timeout. It started at 22:59:21 UTC and returned at 23:06:21.step=30running for the whole sleep, thenstep=31at 23:06:21 the moment the tool returned, and the session went on working until 23:41. There is no assistant message in the session with a silent stop (finish: stopwith no text).sleep, which is a UX question outside the engine loop.stopturn settled silently) is a different mechanism. The amicode silent-turn guard already covers it when the reasoning text is non-empty, and nothing in this incident matches it.Tests (session loop, existing
TestLLMServerharness)In
packages/opencode/test/session/prompt.test.ts:loop answers the replayed request after auto-compacting a provider overflow (#2129): a 413 overflow leads to a summary, then the replayed request, which is answered in the same loop. The last model request carries both the pending request and the summary.loop continues the turn after auto-compacting at the context limit mid-task (#2129): a tool step whose usage crosses the usable context leads to compaction, then the auto-continue instruction, and the turn goes on past the summary.loop continues after a polling bash call and picks up a message sent mid-poll (#2136): twosleep; echopolls. The loop returns each result to the model and picks up a user message sent during the first poll.All three pass on unmodified
main, which is consistent with the findings. To show they guard the reported symptoms, I mutated the materialized loop and confirmed that:breakafter compaction (turn ends on the summary), tests 1 and 2 fail;Observation (not changed)
On the non-replay auto path (test 2), the continued turn receives
[compaction prompt, summary, preserved tail, "Continue if you have next steps, or stop and ask…"]. If the turn's user message falls outside the preserved tail (2k–8k tokens), the request reaches the model only through the summary. The summarizer template does capture it ("Current request: …" in the real summaries), and no incident shows a drop. Making the request verbatim on this path would be a compaction-design change (#1820/#1927 territory), not a fix for these reports.Proposed disposition
Verification
bun test test/session/prompt.test.ts test/session/compaction.test.ts(materialized tree): 118 pass, 2 skip, 0 failbash packages/app-bundle/scripts/engine_typecheck_gate.sh: OK (only Base-pin drift: manifest upstream_base_sha stale vs absorbed overlay #1229 allowlisted errors)node packages/app-bundle/scripts/refresh_manifest.mjsthendrift_gate.mjs: PASS (manifest hash updated for the test file)🤖 Generated with Claude Code