Repository navigation
Conversation
The compaction.blocked event fires when the turn is waiting for an active auto-compaction to finish, not when compaction is blocked by the turn. The old message told users to retry, but the turn continues automatically after compaction completes. Change the ACP-surfaced text from 'Compaction is blocked by the current turn; retry when the turn is idle.' to 'Waiting for context compaction to finish; the turn will continue automatically.'
🦋 Changeset detectedLatest commit: 0df1764 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0df176416d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| events.on('compaction.blocked', () => { | ||
| this.emitLocalChunk( | ||
| 'Compaction is blocked by the current turn; retry when the turn is idle.', | ||
| 'Waiting for context compaction to finish; the turn will continue automatically.', |
There was a problem hiding this comment.
Avoid promising that every blocked turn will continue
When automatic compaction fails, packages/agent-core-v2/test/agent/fullCompaction/fullCompaction.test.ts:1257-1287 establishes that the blocked turn ends with reason: 'failed' rather than continuing. This unconditional message therefore remains misleading for compaction failures—the same persisted assistant-text problem this change is intended to fix—so the continuation claim should be conditional or omitted.
Useful? React with 👍 / 👎.
| "@moonshot-ai/kimi-code": patch | ||
| --- | ||
|
|
||
| Fix misleading "compaction is blocked" message during automatic context compaction — the turn is waiting for compaction to finish and continues automatically; the old wording incorrectly told users to retry. |
There was a problem hiding this comment.
Shorten the changeset to the user-visible change
The entry continues after the actual change with clauses explaining the runtime mechanism and why the old wording was wrong. The repository requires changesets to be one short user-facing sentence stating only what changed, so reduce this to the corrected compaction-status wording without the explanatory clauses.
AGENTS.md reference: AGENTS.md:L86-L88
Useful? React with 👍 / 👎.
Related Issue
Resolve #3629
Problem
During a successful automatic compaction, the ACP client receives "Compaction is blocked by the current turn; retry when the turn is idle." as an
agent_message_chunk. This is misleading because:compaction.blockedevent fires when the turn is waiting for an active compaction to finish — not when compaction is blocked by the turn. The causality is reversed in the message.agent_message_chunk.The engine's own test (
blocks the turn until auto compaction finishes) already demonstrates the correct lifecycle:compaction.blocked→full_compaction.complete→turn.step.started→turn.ended.What changed
One string change in
packages/acp-server/src/session.ts: thecompaction.blockedhandler now emits "Waiting for context compaction to finish; the turn will continue automatically." instead of the reversed/misleading retry instruction.This accurately describes the actual state: the turn is paused while compaction runs and will resume on its own.
Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.