Repository navigation
fix(kimi): drop the per-cwd -c sentinel so kimi threads cannot resume each other's session (#220) - #350
Merged
currentbits merged 3 commits intoAug 17, 2026
Conversation
added 3 commits
August 17, 2026 19:49
A fresh Start-task thread that already carries the legacy cwd session sentinel was continuing some other kimi conversation in that directory, so the issue prompt arrived as a follow-up and the agent acted like it had no task. Skip -c until this thread has an assistant reply; -S still resumes a real session id.
…er (#220) -c continues the last session in the working directory, not this thread. Two no-worktree kimi threads in the same project therefore bled: after a hint-less turn stamped sessionId "cwd", the next -c resumed whoever last ran in that folder. Stop inventing the sentinel, stop emitting -c, and heal leftover "cwd" rows to null. Resume only via -S with a real id.
… kimi per-cwd -c sentinel let threads resume each other's session (#220)
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
currentbits
deleted the
coder/kimi-threads-started-from-the-planboard--472d94
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 #220.
The reported symptom was not the reported cause
Issue #220 says a kimi thread started from the planboard "does not know the task", which points at the prompt never reaching the CLI. It does. Verified live against kimi 0.36.0: a fresh
-pwith a multiline GitHub issue body is delivered intact, and a brand-new thread hassessionId: null(services.jscreateThread, andsetProviderclears it on a provider change), so its first turn emits no resume flag at all.Actual root cause
-cis per-directory, not per-thread, and Solenta stampedsessionId: "cwd"after any kimi turn that produced no resume hint (electron/runner.js,capturedKimiSessionId || thread.sessionId || "cwd").Every kimi thread without its own worktree runs in the same project folder, so:
"cwd".-cand resumes B's session. A's prompt arrives as a follow-up to a conversation about someone else's task, and the agent behaves as if it was handed nothing.This is a second-turn-and-later bug, and it bleeds across threads. A first turn was never affected.
The fix
Drop the sentinel instead of guarding it. kimi emits real resume hints and
-S <id>works, so the per-cwd continue is dead legacy — deleting it is a smaller diff than defending it.electron/runner.js— a hint-less turn storesnull, never"cwd"; an existing real session id is still preserved.electron/providers.js— deleted the-cbranch from kimibuildArgs; a leftover"cwd"is treated as no session rather than passed as-S cwd.electron/store.js— load heals leftover"cwd"rows tonull, so existing stores stop bleeding without a migration step.An intermediate first-turn guard was written and then removed, so there is one defense here rather than three overlapping ones.
Verification
Regression test:
thread A's second turn does not -c into a session only thread B created— a hint-less turn on A, then a real session id captured by B in the same project directory, then A's second turn must emit neither-cnor B's id.Checked both directions rather than trusting a green run: 74 pass across
kimi.test.js/store.test.js/providers.test.json this branch, and reverting only the three source files (leaving the tests) fails 11. Full suites: electron 973/975, renderer 823/823. The two electron failures are pre-existing and unrelated — the knownwireClient × webBridgereconnect baseline, and a workflow timing flake that passes whenworkflow.test.jsis run alone.Accepted trade-off
A hint-less older kimi can no longer continue a session across turns. Losing resume is a better failure than silently resuming a different thread's conversation.
Deliberately out of scope
Planboard live steps only work for claude; codex/opencode/kimi plans never appear #180 (planboard live steps only work for claude) — genuinely different root cause: plan-step parsing only reads Claude
TodoWrite.Worktree GC clearing a real
-Sid viastore.jswhenworktreePathchanges — related session hygiene, not this bleed.PR created by the Claude Code agent