Bound and clear the ACP compaction prose buffer - #3013
Open
bradhallett wants to merge 1 commit into
Open
Conversation
This was referenced Sep 3, 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.
Human comments
Follow-up to #2293, addressing the two review findings SlopCop left on the merged commit (
eece92f8):compactionOutcomeForEndTurn(dialect, …)withdialect.id !== "omp"short-circuiting tocompleted). No further change needed; this PR builds on that shape.What was wrong
handleAgentNotificationaccumulated everyagent_message_chunkstreamed during a compaction prompt intosession.compactionAgentMessagefor every dialect, even though only the omp dialect ever reads the text — unbounded growth on a long-lived session.startCompaction, so after a compaction completed, the text stayed resident until the next compaction began.What changed
collectsCompactionAgentMessage(session.dialect)— the dialect module owns the "does this dialect parse compaction prose" decision, so non-omp dialects carry no classifier state at all.COMPACTION_AGENT_MESSAGE_CAP), keeping the head of the message: omp's failure/no-op prose ("Compaction failed: …", "Nothing to compact") leads its compaction report.finishCompaction— the single settlement funnel that success, failure, and interrupt all route through. The now-redundant reset atstartCompactionis removed; session-creation initialization covers the first compaction.fake-acp-agent.mjsgainsFAKE_ACP_COMPACT_AGENT_MESSAGES(JSON string array; one message per/compactrequest, last entry repeats) so one session can exercise sequential compactions with different prose.How you verified
thread/compacted— kills cap removal;finishCompactionclear.completed-outcome regressions rather than a test that could not fail.turbo run test typecheck --filter=@bb/provider-bridge-acp --force— 18/18 test files, typecheck clean;oxfmt --checkclean;oxlintzero new findings (the pre-existingbb(no-comments)hits in the.mjsharness are identical to main: 15 before, 15 after);check-npm-version-guardPASS at 0.4.41.