kimi-code/.changeset/fix-fork-session-files.md
Haozhe 0527ca2267
fix(agent-core-v2): carry session state across fork and ignite toolDedupe (#1629)
* fix(agent-core-v2): ignite toolDedupe plugin on agent creation

- ignite IAgentToolDedupeService in AgentLifecycleService before external
  hooks so it sits ahead of permission on onBeforeExecuteTool
- mirror the ignition in the test harness AgentTestContext
- add lifecycle test asserting the dedupe hooks are registered

* fix(agent-core-v2): carry session files and cron tasks over on fork

- copy blobs, plans, background-task output, and media originals into the
  forked session dir (excluding state.json, wire logs, and logs/)
- duplicate the source session's cron tasks with fresh ids retagged to the
  target session via the shared CRON_SESSION_TAG
- roll back the half-fork on failure: drop the materialized handle from the
  live registry and delete the target session dir
2026-07-13 22:53:35 +08:00

305 B

@moonshot-ai/agent-core-v2 @moonshot-ai/kimi-code
patch patch

Fix session fork losing everything except the conversation log: forked sessions now carry over media attachments, plan files, background task output, and cron tasks, and a failed fork no longer leaves a broken half-copy behind.