Skip to content

fix(tui): clear editor draft on Ctrl-C during compaction - #1076

Merged
liruifengv merged 2 commits into
mainfrom
fix/ctrl-c-compaction-clear-text
Jun 24, 2026
Merged

fix(tui): clear editor draft on Ctrl-C during compaction#1076
liruifengv merged 2 commits into
mainfrom
fix/ctrl-c-compaction-clear-text

Conversation

@liruifengv

Copy link
Copy Markdown
Collaborator

Related Issue

No related issue.

Problem

Pressing Ctrl-C while compaction is in progress cancelled the compaction immediately, even when the editor contained a draft. This was inconsistent with streaming, where Ctrl-C clears the editor draft first and only cancels the turn when the editor is empty.

What changed

Ctrl-C now clears a pending editor draft first during compaction, and only cancels the compaction once the editor is empty — matching the existing streaming behavior. The clear-text step is shared between the compaction and streaming branches, so it covers every non-idle turn phase without affecting the BTW panel, in-flight requests, or the idle double-Ctrl-C exit. Added a test covering the compaction case.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • 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.

When compaction is in progress and the editor has a draft, Ctrl-C now clears the draft first instead of cancelling compaction, matching the streaming behavior. The clear-text logic is shared between the compaction and streaming branches.
@changeset-bot

changeset-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8fdf196

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

@pkg-pr-new

pkg-pr-new Bot commented Jun 24, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@8fdf196
npx https://pkg.pr.new/@moonshot-ai/kimi-code@8fdf196

commit: 8fdf196

@liruifengv
liruifengv merged commit 500677a into main Jun 24, 2026
8 checks passed
@liruifengv
liruifengv deleted the fix/ctrl-c-compaction-clear-text branch June 24, 2026 12:30
@github-actions github-actions Bot mentioned this pull request Jun 24, 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.

1 participant