Repository navigation
fix(bin): answer Kimi 2.3.0's folder prompt and refuse one that announces project MCP servers - #7693
Conversation
|
Speaking as Kun's firstmate: thank you @tiago-peixoto. This covers everything #7658 asked for in one PR, and it comes with real 2.3.0 evidence. What I checked (head Contract-class (my own read): restore. Kimi launches are an existing default path that 2.3.0 broke, and the only other change is a refusal on prompts that couldn't launch on main anyway. VISION.md per rule: One captain aligns (the refusal names its reason) · Authority aligns (refuses instead of consenting to project MCP servers for the captain) · Scripts aligns (deterministic pane predicates) · Restart neutral · Delegation aligns (live guard + replay captures) · Vendor aligns (the rendered prompt is read by version-pinned, recorded predicates with their own live guard) · Scope aligns. Status: waiting on CI, not on you. Two checks are red. |
|
Speaking as Kun's firstmate: thanks again @tiago-peixoto. A quick update, and this one now needs something from you, sorry. Main's "packing exactly at the budget" fix landed in Could you rebase onto current main and push again (or re-raise via |
…nces project MCP servers Kimi Code CLI 2.3.0 reworded its folder prompt: the options now read "Trust and continue" and "Exit", so the complete-dialog test in bin/fm-spawn.sh never passed and every Kimi launch stopped at the prompt with no key sent. The same release reads a root .mcp.json at the git worktree root as a project MCP declaration (its documentation names only .kimi-code/mcp.json) and announces declared servers on the prompt as "Start N MCP server(s) automatically" over "Config: <file>"; pressing Enter there starts those servers before any login. Move the prompt predicates into bin/fm-kimi-trust-lib.sh, recognize both recorded wordings, and refuse, before any key, a prompt that announces project servers or that pages its disclosure (a short pane keeps the complete dialog on screen and can hide the announcement on another page). The launch fails naming the reason; a prompt with no announcement is answered as before, and kimi -p is untouched. Replay the prompts recorded from the real 2.3.0 CLI through the Kimi suite's fake pane, one case per wording.
Launch the installed Kimi bare in a private tmux server with a disposable home and its updater off, and check every recorded prompt wording against the predicates bin/fm-spawn.sh answers with: the plain prompt is complete and Enter clears it, each declaring directory is announced and never answered with its command never run, and short panes collapse or page the prompt. No prompt text is submitted, so it spends no tokens and needs no login. Record the dated 2.3.0 and 2.3.1 result in the verification record.
Name both recorded option pairs, the project-server announcement, the paged and collapsed renderings, and the root .mcp.json read in the Kimi adapter reference, and point the configuration guide's harness restrictions at it.
baacdc5 to
b47517d
Compare
|
Speaking as Kun's firstmate: this is merged. Thank you @tiago-peixoto — really appreciate you taking the time on this. Thanks for the quick rebase. The fresh run on |
Fixes #7658.
Rebased onto main at d22640f, which includes the packing-at-budget fix 98f3bd8 that also touches
bin/fm-test-run.sh; the rebase kept that fix and re-added only this change's timing hint and family mapping, and the one conflict (two new sentences at the same spot indocs/fm-test-portable-shards.md) was resolved by keeping both. All 19 checks pass on b47517d.Intent
Fix all three Kimi Code CLI 2.3.0 breaks from #7658 together, so a Kimi worker launches again on 2.3.0, and so a 2.3.0 folder prompt that announces project MCP servers is refused rather than answered. Restoring launches is the existing default path; nothing new is on by default beyond that restore and the refusal the triage asked for, so there is no new switch.
Related: #6741 (issue #5226), which reads
.kimi-code/mcp.jsonbefore launch and refuses a 2.1.1 prompt by itsProject MCP targets:header. This pull request does not build on that branch or change it; its backstop and declaration read can be extended to the 2.3.0 wording and the root.mcp.jsonwhen it lands.What changed
bin/fm-kimi-trust-lib.sh(new) owns the folder-prompt predicates over one visible-pane capture: the complete dialog in both recorded wordings (❯ Trust this folder/Don't truston 2.0.0 and 2.1.1,❯ Trust and continue/Exiton 2.3.0), any dialog marker, a paged disclosure (←→ page · N / M), and a project-server announcement (Start N MCP server(s) automaticallyoverConfig: <file>, either line alone).bin/fm-spawn.shsources it. Its Kimi readiness loop now refuses, before any key, a prompt that announces project MCP servers or pages its disclosure, failing the launch with the reason; a complete prompt with no announcement is answered as before, and the stuck-dialog diagnostics quote the wording the pane showed.kimi -pis untouched..mcp.jsonat the git worktree root as a project declaration in addition to.kimi-code/mcp.json(its documentation names only the latter), and the prompt'sConfig:line names whichever file declared the servers. Reading the prompt covers every location the installed Kimi actually reads.tests/fm-kimi-harness.test.shgains one case per recorded 2.3.0 wording, replayed fromtests/captures/kimi-code-2.3.0/(plain, root.mcp.json,.kimi-code/mcp.json, collapsed, paged); each guards its line (see below).tests/fm-kimi-trust-prompt-live-e2e.test.shis a default-on, token-free live guard that launches the installed Kimi bare in a private tmux server with a disposable home and checks every wording;docs/verification/runtime-backends.mdrecords its dated result.Live evidence, Kimi Code CLI 2.3.0
Real
bin/fm-spawn.shdriven against the real Kimi Code CLI 2.3.0 installed into an isolated prefix, with an isolatedKIMI_CODE_HOME, the updater off, a private tmux server, and a disposable Firstmate home. Each declared server command appends a line to a marker log. The same runs against 2.3.1 (released the same day) gave the same results and renderings.Before the fix
Every case stopped at the prompt with no key sent:
Plain directory (the prompt the launch could not recognize):
Root
.mcp.json:Pressing Enter by hand on that prompt in the same lab started the declared command before any login (marker log afterwards):
After the fix
Plain directory: the prompt is answered, Kimi reaches its composer, and the brief pointer is typed and submitted. The lab has no login, so Kimi answers the submission with
Error: LLM not setand the launch stops at delivery confirmation, which needs a model reply; the folder prompt is no longer the stopping point.Root
.mcp.json: refused before any key, marker log empty..kimi-code/mcp.json: refused before any key, marker log empty.Root
.mcp.jsonin a 14-row pane (the prompt pages; here the announcement happens to be on the shown page):Live guard
Test evidence
bash tests/fm-kimi-harness.test.sh: 35 ok. Mutations, each run separately and reverted: dropping the 2.3.0 option pair from the complete-dialog test failsthe recorded 2.3.0 prompt with no project servers should be answered into a verified spawn; making the announcement predicate never fire failsa 2.3.0 prompt announcing a root .mcp.json server should not pass readiness; making the page predicate never fire failsa 2.3.0 prompt that pages its disclosure should not pass readiness.bin/fm-lint.sh,bin/fm-doc-audience-check.sh, andtests/fm-test-run.test.shpass.Not covered here
✨user-message bullet with❯, so the confirmation's echoed-bullet signal cannot fire any more and only the nonzero-context fallback remains. The lab has no login, so this could not be observed live; worth a follow-up with a logged-in worker.Access N folder(s) outside this projectdisclosure (additional directories) is not refused; this pull request is scoped to project MCP servers.Intent
Open one pull request for #7658 that fixes all three Kimi Code CLI 2.3.0 breaks together and makes any new default behavior opt-in. A 2.3.0 prompt that announces project servers is refused, not answered. The pull request carries live 2.3.0 evidence.
Issue 7658 in short: Kimi 2.3.0 rewords its folder prompt ("❯ Trust and continue" / "Exit", "No project integrations or instructions to activate.", or "Start N MCP server(s) automatically" with "Config: "). (1)
kimi_trust_dialog_is_visiblein bin/fm-spawn.sh still requires "❯ Trust this folder" and "Don't trust", so every Kimi launch on 2.3.0 stops at the prompt and fails with no key sent. (2) The "Project MCP targets:" header that the backstop in open PR 6741 matches is gone on 2.3.0. (3) Kimi 2.3.0 reads a root.mcp.jsonas a project server declaration, and the declaration check in PR 6741 reads only.kimi-code/mcp.json.Kun's side triaged it (#7658 (comment)) as contract-class restore and labeled it ready-for-pr: restoring Kimi launches restores the existing default path; a fix for break 1 must refuse, not answer, any 2.3.0 prompt that announces project servers ("Start N MCP server" / "Config: .mcp.json"), with a test for each supported wording; the pull request should carry the live 2.3.0 evidence: plain directory passes, root
.mcp.jsonand.kimi-code/mcp.jsonboth refused before any key, marker log empty.What Changed
bin/fm-spawn.shnow recognizes the Kimi Code CLI 2.3.0 folder prompt (❯ Trust and continue/Exit) alongside the 2.0.0 wording, so a Kimi launch on 2.3.0 answers the prompt instead of timing out with no key sent. The predicates move into a newbin/fm-kimi-trust-lib.shshared with the live guard, and the readiness loop refuses, before the complete-dialog test, any prompt that announces project MCP servers (Start N MCP server(s) automatically/Config: <file>, covering both a root.mcp.jsonand.kimi-code/mcp.json) or that pages its disclosure (←→ page · N / M), failing readiness with the reason rather than pressing Enter.tests/fm-kimi-harness.test.shreplays five recorded 2.3.0 panes undertests/captures/kimi-code-2.3.0/(plain, root.mcp.json,.kimi-code/mcp.json, collapsed short terminal, paged); a new default-on live guardtests/fm-kimi-trust-prompt-live-e2e.test.shlaunches the installed Kimi bare in a private tmux server and checks each wording against the real binary.bin/fm-test-run.shmaps the new lib andtests/captures/<dir>/paths to their suites.docs/configuration.md, anddocs/verification/runtime-backends.mdrecord the 2.3.0 wordings, the refusal rules, and the observed live output for 2.3.0 and 2.3.1.Risk Assessment
✅ Low: The change is confined to Kimi's folder-prompt predicates and their readiness-loop ordering, every recorded 2.3.0 pane traces to the intended verdict (plain answered once, announcing and paged refused before any key, collapsed never ready), the 2.0.0 wording keeps its path, the two earlier review decisions are honored, the capture-mapping arm mirrors the fixture arm and resolves to the Kimi suite, and the previously declined CI packing failure is fixed by main's commit now in this branch's ancestry.
Testing
Exercised the Kimi 2.3.0 folder-prompt change end to end against real Kimi binaries: the live guard tests/fm-kimi-trust-prompt-live-e2e.test.sh passed on 2.3.0 and 2.3.1; the real fm-spawn.sh in a lab FM_HOME refused the root .mcp.json and .kimi-code/mcp.json projects (and the paged 100x12 and collapsed 100x7 panes) with the intended reasons and an empty marker log, and answered the plain project's prompt and typed the brief pointer; bin/fm-test-run.sh --list --changed maps the new tests/captures files where the base commit's runner died. The replay suite tests/fm-kimi-harness.test.sh passed including the five recorded-pane cases, but that suite feeds recorded pane captures to fm-spawn instead of a running Kimi, so it does not count as a live result. Two environment issues were worked around and are not product defects: the host's mise shims fail when HOME is redirected (real interpreter dirs were put ahead on PATH), and Kimi 2.3.0 self-updated to 2.3.1 in place when the tmux pane lacked KIMI_CODE_NO_AUTO_UPDATE=1, so the lab was redone with the flag and a lab HOME set on the tmux session; the first run's real-home ~/.kimi-code and treehouse pool leftovers were removed. Brief delivery confirmation after the plain prompt is untested because no Kimi login exists on this host and the runbook forbids signing in. No UI screenshots: the surface is a terminal pane, captured as tmux capture-pane text.
Evidence: Live guard against real Kimi 2.3.0
Source: Live guard against real Kimi 2.3.0
Evidence: Live guard against real Kimi 2.3.1
Source: Live guard against real Kimi 2.3.1
Evidence: Real fm-spawn.sh lab transcript: spawn output, status files, Kimi binary versions, marker log, trust records, brief pointer
Source: Real fm-spawn.sh lab transcript: spawn output, status files, Kimi binary versions, marker log, trust records, brief pointer
Evidence: Kimi 2.3.0 pane after fm-spawn refused the root .mcp.json project
Source: Kimi 2.3.0 pane after fm-spawn refused the root .mcp.json project
Evidence: Kimi 2.3.0 pane after fm-spawn refused the .kimi-code/mcp.json project
Source: Kimi 2.3.0 pane after fm-spawn refused the .kimi-code/mcp.json project
Evidence: Kimi 2.3.0 pane after fm-spawn answered the plain project's prompt
Source: Kimi 2.3.0 pane after fm-spawn answered the plain project's prompt
Evidence: Kimi 2.3.1 pane after fm-spawn refused the root .mcp.json project
Source: Kimi 2.3.1 pane after fm-spawn refused the root .mcp.json project
Evidence: Kimi 2.3.0 paged prompt in a 100x12 pane that fm-spawn refused
Source: Kimi 2.3.0 paged prompt in a 100x12 pane that fm-spawn refused
Evidence: Kimi 2.3.0 collapsed prompt in a 100x7 pane that fm-spawn never answered
Source: Kimi 2.3.0 collapsed prompt in a 100x7 pane that fm-spawn never answered
Evidence: Replay suite tests/fm-kimi-harness.test.sh
Source: Replay suite tests/fm-kimi-harness.test.sh
Evidence: Changed-test selection before and after the tests/captures mapping fix
Source: Changed-test selection before and after the tests/captures mapping fix
### base commit d22640f4 runner: --list --changed --base d22640f4 fm-test-run: no changed-test mapping for source path: tests/captures/kimi-code-2.3.0/README.md ### target commit runner: bin/fm-test-run.sh --list --changed --base d22640f4 exit=0 selected 115 scripts; the readers of tests/captures/* among them: tests/fm-crew-state.test.sh tests/fm-kimi-harness.test.sh tests/fm-kimi-trust-prompt-live-e2e.test.shPipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
🔧 **Rebase** - 1 issue found → auto-fixed ✅
docs/fm-test-portable-shards.md- merge conflict rebasing onto origin/main🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
FM_KIMI_TRUST_PROMPT_LIVE=1 PATH=<disposable kimi 2.3.0>:... bin/fm-test-run.sh tests/fm-kimi-trust-prompt-live-e2e.test.sh(pass, 15.8 s)FM_KIMI_TRUST_PROMPT_LIVE=1 PATH=<disposable kimi 2.3.1>:... bin/fm-test-run.sh tests/fm-kimi-trust-prompt-live-e2e.test.sh(pass)bin/fm-test-run.sh tests/fm-kimi-harness.test.shwith real python/node dirs ahead of the mise shims (pass, all test_kimi_230_* cases; recorded-fixture replay, not live)Realbin/fm-spawn.sh <id> <lab project> --harness kimi --mode local-only --yolo offinside abin/fm-lab-home.sh createlab on tmux socket fm-lab, with HOME=<lab>/home and KIMI_CODE_NO_AUTO_UPDATE=1 set on the session: root .mcp.json project (Kimi 2.3.0 and 2.3.1), .kimi-code/mcp.json project, plain project, plus 100x12 and 100x7 sessions for the root .mcp.json projectKimi process version proof viareadlink /proc/<pid>/exeand<exe> --versionfor every lab windowLab-home inspection:.kimi-code/workspace-trust/holds only the plain worktree;.kimi-code/user-historyholds the typed brief pointer;marker.logof the declared MCP server stayed 0 bytesbin/fm-test-run.sh --list --changed --base d22640f4on the target (exit 0, selects fm-kimi-harness, fm-kimi-trust-prompt-live-e2e, fm-crew-state) versus the base commit's runner (dies: no changed-test mapping for tests/captures/kimi-code-2.3.0/README.md)Teardown: lab tmux server killed, lab home, disposable Kimi prefixes, per-task /tmp dirs and lab treehouse pools removed; worktreegit statuscleanbin/fm-spawn.sh:3330- The preflight refusal for a backend without viewport capture still reads "Kimi 2.0.0 gates a fresh worktree on a trust dialog ...". The branch records that 2.3.0 shows the same prompt in a new wording, and the header comment at bin/fm-spawn.sh:525 was updated to say so, but this operator-facing error string was not. No test asserts the string. It is executable output, not documentation, so this phase left it unchanged; a one-word edit (drop "2.0.0" or say "Kimi") in the code phase would align it with the header and the adapter reference.✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.