MoonshotAI / MoonshotAI/kimi-code

VS Code: cancelled compaction appears completed and old cards animate

Open
#3,337 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7.5k
Forks
1.2k
Avg merge
11h 53m
Merged PRs (30d)
350

Description

Environment

  • Kimi Code VS Code extension: 0.7.1; also reproduced against main at d8317d81e
  • Open platform/subscription: N/A; the bug is in the Webview event projection and is provider-independent
  • Model: N/A; the bug is model-independent
  • Platform: Microsoft Windows 10.0.26100 x64

What issue are you seeing?

Stopping a running /compact operation makes its card show a green success indicator and the text Context compacted, even though the compaction was cancelled.

Starting /compact again also makes both the old card and the new card show the spinning animation. Only the current compaction is running.

Steps to reproduce

  1. Open a VS Code Kimi Code session with enough context to compact.
  2. Run /compact.
  3. Click Stop while compaction is still running.
  4. Observe that the cancelled card becomes green and says Context compacted.
  5. Run /compact again.
  6. Observe that both compaction cards animate.

The behavior is deterministic in a minimal event-pipeline reproduction:

  • compaction.cancelled is projected to the same empty CompactionEnd event as compaction.completed and compaction.blocked.
  • Each transcript compaction item stores only { type: "compaction" }.
  • Every CompactionCard renders from the session-wide isCompacting boolean.

Expected behavior

  • A cancelled compaction should use a non-success terminal state such as Compaction stopped.
  • A completed compaction should retain the green success state.
  • Only the currently running compaction card should animate.

Additional information

The runtime already distinguishes cancellation: the host action finishes with status: "cancelled", and the successful The context has been compacted. message is not emitted after cancellation. The outcome is lost between the SDK event adapter and the Webview item model.

I can submit a focused fix that preserves the compaction outcome in the Webview event, stores status per compaction item, and adds adapter/store/rendering regression coverage.

Contribution

  • I am willing to submit a PR for this bug fix myself and will wait for a maintainer's /approve comment before opening it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the SDK event adapter and Webview event projection, then trace how compaction items are stored and rendered by CompactionCard. Preserve the cancelled, completed, and blocked outcomes, keep status per compaction item, and add adapter, store, and rendering regression coverage. Done means cancelled cards show a non-success state and only the current compaction animates.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.