kimi-code/packages
Kai ea55911062
feat(agent-core): sharpen the compaction handoff prompt (#1283)
* feat(agent-core): sharpen the compaction handoff prompt

Refine the first-person handoff note the model writes at compaction so it
preserves what actually gets dropped instead of what already survives:

- Lead with the intent of the latest request, not a verbatim re-transcription
  (the recent user messages are already kept verbatim beside the summary);
  name which request governs when several are in play.
- Carry forward tool results — the concrete values, key lines, schemas — not
  just the commands that produced them.
- Keep settled decisions separate from still-open questions, and name the
  context the next turn must go and re-check.
- Write in the conversation's language, keep the note proportional to the task,
  and don't re-transcribe the auto-attached TODO list.

Also correct the system prompt's description of the post-compaction shape: the
recent user messages come first, followed by a first-person summary (not a
rigidly sectioned report), and a newer kept message supersedes the summary.

Update the affected inline snapshots and the compaction request token count.

* fix(agent-core): preserve an oversized latest request in the handoff note

selectRecentUserMessages truncates a kept user message to the size cap,
keeping only its prefix, so when the latest request itself exceeds the cap
only its head survives verbatim beside the summary. Telling the summary
"don't re-transcribe, it survives verbatim" then permanently dropped the
tail — often the actual ask. Keep the intent-not-transcription guidance,
but require preserving the at-risk parts of a long current request.
2026-07-02 13:44:29 +08:00
..
acp-adapter ci: release packages (#1268) 2026-07-02 11:12:20 +08:00
agent-core feat(agent-core): sharpen the compaction handoff prompt (#1283) 2026-07-02 13:44:29 +08:00
kaos ci: run unit tests on windows (#1037) 2026-06-26 11:56:41 +08:00
kimi-migration-legacy feat(web): introduce Kimi web app and daemon gateway (#625) 2026-06-17 20:53:46 +08:00
kosong ci: release packages (#1268) 2026-07-02 11:12:20 +08:00
migration-legacy ci: release packages (#1268) 2026-07-02 11:12:20 +08:00
node-sdk ci: release packages (#1268) 2026-07-02 11:12:20 +08:00
oauth feat: add model alias overrides (#1262) 2026-07-01 19:57:13 +08:00
pi-tui ci: release packages (#1268) 2026-07-02 11:12:20 +08:00
protocol ci: release packages (#1268) 2026-07-02 11:12:20 +08:00
server ci: release packages (#1268) 2026-07-02 11:12:20 +08:00
server-e2e fix(web): stop auto-dismissing pending questions and approvals on a timeout (#1070) 2026-06-24 19:15:06 +08:00
telemetry ci: run unit tests on windows (#1037) 2026-06-26 11:56:41 +08:00