Skip to content

fix(acp): correct misleading compaction-blocked message wording - #3650

Closed
535628443 wants to merge 1 commit into
MoonshotAI:mainfrom
535628443:fix-acp-compaction-blocked-wording
Closed

535628443 wants to merge 1 commit into
MoonshotAI:mainfrom
535628443:fix-acp-compaction-blocked-wording

Conversation

@535628443

@535628443 535628443 commented Sep 8, 2026 •

Copy link
Copy Markdown

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:

  1. The compaction.blocked event 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.
  2. The turn continues automatically after compaction completes — no user action or retry is needed.
  3. The misleading text is retained as assistant text by clients that persist 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: the compaction.blocked handler 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

  • I have read the CONTRIBUTING document.
  • I have linked a related issue (external PRs: the issue must have a maintainer's /approve).
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

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-bot

changeset-bot Bot commented Sep 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0df1764

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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.',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@535628443 535628443 closed this Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(acp): successful auto-compaction wait is reported as blocked with a misleading retry instruction

1 participant