Repository navigation
Stop kimi runs from seeing other projects' MCP servers, threads and memory (#671) - #674
Merged
currentbits merged 2 commits intoAug 22, 2026
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…-issue-with-cross-contami-d6e244 # Conflicts: # electron/runner.js
currentbits
deleted the
coder/fork-we-have-an-issue-with-cross-contami-d6e244
branch
October 3, 2026 16:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #671.
Kimi has no
--mcp-config, so every Solenta-spawned kimi turn read the user-global~/.kimi-code/: onemcp.jsonholding every project's MCP servers, and aworkspaces.jsonlisting every directory the CLI had ever opened. A run in project A could reach project B's threads, memory and tree.Fixed in three layers, so the scope is enforced by the servers rather than by model discipline.
Per-run
KIMI_CODE_HOMEoverlay —materializeKimiHome(electron/kimi.js), wired at electron/runner.js:4010. Copiesconfig.toml, symlinks credentials/oauth/sessions/cache so login and-Sresume still work, then writes a freshmcp.jsoncontaining only Solenta's servers and aworkspaces.jsoncontaining only this run's cwd.AGENTS.mdand workspace-trust are never copied. Skipped for ssh/WSL projects (the overlay lives on this host) and whenuserDataPathis unset; a failed overlay is non-fatal and the turn proceeds. Side benefit: theconfig.tomleffort-flip race is now local to the overlay instead of global.Bound MCP sessions — the per-run
mcp.jsonappends?project=/?projectId=to the server URLs.memory-server(buildServer({ bindProject })) forces every tool to that project and rejects a claimed different one;orchServertreats the bound id as proof of caller identity, outranking whatever the tool args claim, andthread_statusnow runs the same-project check it was missing.threads_listis now project-scoped — it requires aprojectIdand returns only that project's threads. It previously returned every thread in every project, which is exactly how an agent picked another project's thread by title. Note this applies to all providers, not just kimi: athreads_list()call with no args is now an error.Tests: new
electron/test/kimi-home.test.js(overlay contents, symlinks, noAGENTS.md, mcp/workspace isolation), plus orch-server binding cases and memory-server scoping cases. Verified green in the worktree — kimi-home/orch-server/kimi/kimi-effort 90 pass 0 fail,test:memory205 pass 0 fail.Of the 857 changed lines, 453 are tests; the production diff is roughly 400 across 5 files.
Known follow-up, not addressed here:
kimi-homes/<threadId>dirs are never reclaimed. They are tiny (symlinks plus three small files) but accumulate one per thread.🤖 Generated with Claude Code