kimi-code/packages
Haozhe 794714ebef
fix(agent-core-v2): gate plugin changes behind session baselines and reminders (#2702)
* fix(agent-core-v2): gate plugin changes behind session baselines and reminders

- capture a per-session MCP server baseline (ISessionMcpHandle.isBaselineServer)
  so servers added mid-session (plugin install, mcp.json edit) never register
  tools in live sessions; they take effect on /new, /reload, or resume, while
  removed servers stay tombstoned and fail calls with a removal notice
- stop rebuilding the system prompt on plugin-source catalog changes: the
  frozen skill listing and plugin sections cannot move anyway, and the rebuild
  only churned the ${now} timestamp, invalidating the provider prompt cache
- freeze the Agent tool description's catalog profile list once the session
  catalog has loaded, keeping the tools payload byte-stable across mutations
- append a plugin_change system reminder to live sessions on plugin mutations
  (new IPluginService.onDidMutate; explicit reloadPlugins does not raise it)
- revert the TUI hint to "Run /new or /reload to apply plugin changes." and
  update the plugin/MCP docs and changesets to the corrected contract

* fix(agent-core-v2): import LifecycleScope from app/scopes in sessionOutcomeMirror

#2666 imported LifecycleScope from #/_base/di/scope, which does not export
it (it lives in #/app/scopes), breaking the package build and typecheck on
main.

* fix(agent-core-v2): close the mutation-driven session-start refresh and overlay baseline leaks

Codex review on the PR found two contract leaks:

- a plugin mutation re-pulls the plugin skill source, and the existing
  catalog listener answered with a fresh plugin_session_start reminder —
  injecting the newly installed plugin's instructions into the live session
  alongside (and contradicting) the plugin_change notice. The session-start
  refresh now skips mutation-driven catalog changes (one per mutation,
  counted; explicit reloads keep the old refresh behavior).
- a session created with ephemeral mcpServers kept its MCP baseline open
  until the overlay connect finished; a workspace server added in that
  window (plugin install, config edit) leaked into the live session through
  the merged view. The overlay handle's baseline now freezes on the
  workspace manager's initial load, with the ephemeral names baseline by
  construction.

* fix(agent-core-v2): drop duplicate LifecycleScope import in sessionOutcomeMirror test

---------

Signed-off-by: Haozhe <yanghaozhe@moonshot.ai>
2026-08-06 21:11:03 +08:00
..
acp-adapter feat(agent-core-v2): introduce the Workspace domain and the agent-profile registry extension point (#2366) 2026-07-31 00:38:11 +08:00
acp-server feat(agent-core-v2): add custom agent identity (#2573) 2026-08-04 22:35:15 +08:00
agent-core feat(agent-core-v2): tombstone removed MCP servers and freeze plugin prompt inputs (#2694) 2026-08-06 19:19:51 +08:00
agent-core-v2 fix(agent-core-v2): gate plugin changes behind session baselines and reminders (#2702) 2026-08-06 21:11:03 +08:00
kaos chore: drop #/ import array fallbacks and custom resolution plugins (#1594) 2026-07-13 16:37:35 +08:00
kap-server feat(agent-core-v2): persist the last turn outcome into session metadata for cold listings (#2666) 2026-08-06 20:14:05 +08:00
klient feat(agent-core-v2): persist the last turn outcome into session metadata for cold listings (#2666) 2026-08-06 20:14:05 +08:00
kosong Revert "fix(kosong): match Kimi's standalone "Unsupported image." rejection (…" (#2368) 2026-07-29 20:56:41 +08:00
migration-legacy ci: release packages (#1767) 2026-07-16 18:54:29 +08:00
minidb fix(minidb): silence the transform-types warning from the dev worker (#2632) 2026-08-05 15:53:13 +08:00
node-sdk feat(agent-core-v2): persist the last turn outcome into session metadata for cold listings (#2666) 2026-08-06 20:14:05 +08:00
oauth feat(agent-core-v2): add custom agent identity (#2573) 2026-08-04 22:35:15 +08:00
pi-tui ci: release packages (#1989) 2026-07-22 17:24:39 +08:00
protocol feat(agent-core-v2): tombstone removed MCP servers and freeze plugin prompt inputs (#2694) 2026-08-06 19:19:51 +08:00
telemetry fix: close two silent-exit vectors around unhandled rejections (#1758) 2026-07-16 02:14:14 +08:00
transcript docs: slim root AGENTS.md, move deep package docs to package guides (#2626) 2026-08-05 13:43:33 +08:00
tree-sitter-bash feat(tree-sitter-bash): add a pure-TypeScript bash parser and an agent-core-v2 bashParser service (#2016) 2026-07-28 14:29:08 +08:00