MoonshotAI / MoonshotAI/kimi-code
VS Code: cancelled compaction appears completed and old cards animate
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
mainatd8317d81e - 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
- Open a VS Code Kimi Code session with enough context to compact.
- Run
/compact. - Click Stop while compaction is still running.
- Observe that the cancelled card becomes green and says
Context compacted. - Run
/compactagain. - Observe that both compaction cards animate.
The behavior is deterministic in a minimal event-pipeline reproduction:
compaction.cancelledis projected to the same emptyCompactionEndevent ascompaction.completedandcompaction.blocked.- Each transcript compaction item stores only
{ type: "compaction" }. - Every
CompactionCardrenders from the session-wideisCompactingboolean.
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
/approvecomment before opening it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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