mirror of
https://github.com/MoonshotAI/kimi-code.git
synced 2026-08-21 14:47:17 +00:00
* fix(agent-core-v2): guard config persistence against lossy writes - A failed load no longer clears the in-memory snapshot: the service keeps the last-known-good config, reports an error diagnostic, and taints. set/replace/replaceSections on the persisted layer then fail fast with Error2(config.persist_blocked) instead of erasing the file; memory-layer overrides stay available, and a successful reload clears the taint. - persistDomains is now read-modify-write: the file is re-read and only the domains being written are applied on top of current disk content, so external edits are merged instead of clobbered, and an external delete is honored instead of resurrected. - External changes absorbed at persist time trigger a full reload so change events fire for domains the writer did not touch. * fix(agent-core-v2): rebase set() merges onto re-read config state set(domain, patch) now merges the patch against the freshly re-read file content and refreshes the in-memory snapshot from the same read, so external edits to the same section survive a concurrent write instead of being overwritten by the stale in-memory copy. * fix(protocol): register config.persist_blocked in KimiErrorCode Add the new code to the KimiErrorCode union and kimiErrorCodeSchema so the persist-refusal error payload passes protocol validation across RPC boundaries. * fix(agent-core-v2): compute every config write against the re-read file Move strip/merge/validate for set/replace/replaceSections into the persist rebase callback so each write is derived from the file content re-read at persist time. Overlay strip handlers (e.g. the KIMI_MODEL_* mask restoring default_model) now read the fresh snapshot instead of the stale in-memory one, and the unconditional snapshot sync makes the separate absorbed-external reload redundant. * fix(agent-core-v2): build defaults when the initial config load fails A failed first load has no last-known-good state worth preserving, so fall through with an empty document: registered section defaults are still validated and applied (consumers of defaulted sections keep working), while the taint keeps blocking persisted writes until a reload succeeds. Only reload failures preserve the previous in-memory state. * fix(agent-core-v2): stage re-read config snapshots until the write succeeds Build the rebased raw/rawSnake snapshots in locals and publish them only after the rebase and documentStore.set both succeed, so a validation error or a storage failure cannot leave userValue and effective pointing at different snapshots. stripEnv now takes the staged snapshots explicitly. |
||
|---|---|---|
| .. | ||
| acp-adapter | ||
| acp-server | ||
| agent-core | ||
| agent-core-v2 | ||
| kaos | ||
| kap-server | ||
| klient | ||
| kosong | ||
| migration-legacy | ||
| minidb | ||
| node-sdk | ||
| oauth | ||
| pi-tui | ||
| protocol | ||
| telemetry | ||
| transcript | ||
| tree-sitter-bash | ||