kimi-code/apps/vis
Kai 329846c569
feat(agent-core): keep head and tail of user messages during compaction (#1313)
* feat(agent-core): keep head and tail of user messages during compaction

Compaction used to keep only the most recent 20k tokens of real user
input, so the original task statement was the first thing to vanish in
long sessions. Now, when the user-message pool fits the 20k budget it is
still kept whole; when it overflows, the oldest 2k tokens and the most
recent 18k are kept instead, with an elision marker between the two
segments telling the model what was omitted and that the summary covers
it. The summary prefix and the default system prompt describe the new
shape as well.

The new `keptHeadUserMessageCount` record field keeps restore and the
wire-transcript folded length consistent: records without it (written by
older versions) restore with the original tail-only selection that
produced them, and the vis model-mode projection mirrors the same
head/marker/tail rebuild.

* style(agent-core): drop redundant spread over slice in head selection
2026-07-02 19:24:37 +08:00
..
scripts refactor(vis): rewrite for new agent-core protocol (#34) 2026-05-26 17:57:49 +08:00
server feat(agent-core): keep head and tail of user messages during compaction (#1313) 2026-07-02 19:24:37 +08:00
web feat(vis): support importing debug zips via drag and drop (#1251) 2026-07-01 12:02:08 +08:00
package.json refactor(vis): rewrite for new agent-core protocol (#34) 2026-05-26 17:57:49 +08:00