Skip to content

fix(kun): preserve partial response on interrupt#276

Merged
XingYu-Zhong merged 1 commit into
KunAgent:developfrom
musnows:codex/fix-interrupt-preserve-partial-turn
Jun 14, 2026
Merged

fix(kun): preserve partial response on interrupt#276
XingYu-Zhong merged 1 commit into
KunAgent:developfrom
musnows:codex/fix-interrupt-preserve-partial-turn

Conversation

@musnows

@musnows musnows commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • persist streamed assistant reasoning/text before an interrupted foreground turn is marked aborted
  • keep the current stop button behavior as an interrupt so generated content remains visible after runtime recovery
  • add a regression test for preserving partial assistant text after interrupt

Root cause

Assistant text deltas were emitted over SSE during streaming, but the accumulated assistant item was only persisted after a normal model completion. If the turn was aborted first, recovery from the runtime snapshot had no assistant item to render, so the UI appeared to roll back to the last user prompt.

Validation

  • npm --prefix kun test -- loop.test.ts -t "keeps partial assistant text when interrupting a foreground turn"
  • npm --prefix kun run typecheck

Notes

  • Full npm --prefix kun test -- loop.test.ts still has 3 existing compaction assertion failures unrelated to this change.

@musnows musnows force-pushed the codex/fix-interrupt-preserve-partial-turn branch from 4a27699 to 7159434 Compare June 13, 2026 22:58
@musnows musnows marked this pull request as ready for review June 13, 2026 23:23
@XingYu-Zhong XingYu-Zhong merged commit b80eeae into KunAgent:develop Jun 14, 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.

2 participants