Repository navigation
fix(launchers): kimi-pmoves and kilo-pmoves start the CLI they are named for - #3325
Conversation
… kimi through kimi-pmoves Adds pm-launch-cwd.sh, a shared fragment that moves a launcher's process into its own checkout when the caller's cwd is outside it. Kimi Code and kilo find their project layer (.mcp.json, kilo.json, AGENTS.md) and key session history by cwd, so a launch from a sibling checkout ran against that checkout's files. PMOVES_LAUNCH_KEEP_CWD=1 opts out. `make kimi` passed --config-file/--mcp-config-file directly, which Kimi Code rejects; it now delegates to scripts/kimi-pmoves.sh. `make kilo-pmoves` no longer forces node 5090. Adds stub-CLI tests for both launchers. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ed for kimi-pmoves: Kimi Code (>= 2.x) has no --config-file/--mcp-config-file and exits "unknown option" before any session. The launcher now asks `kimi --help` which program it has: Kimi Code gets the args untouched (and a line saying its config comes from KIMI_CODE_HOME + <repo>/.mcp.json); legacy kimi-cli keeps the .kimi/ flags. kilo-pmoves: exec'd `opencode --config <claws file>` -- the wrong program, a flag neither program has, and a file opencode rejects (mcpServers key). $1 was always a node name defaulting to 5090, so `kilo-pmoves --version` failed. Now execs `kilo` (or `kilocode`) with args passed through; a leading claws node name is accepted and dropped for back-compat. Both source pm-launch-cwd.sh so the session binds to this checkout. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one): 1
Please check the settings in the CodeRabbit UI or the
|
Fleet review: kilocode (zai-coding-plan/glm-5.3)reviewer: tier 2/3
reviewer chain
_ lane: fleet-review chain (self-hosted kvm4) - spark-local (when online) -> kilo-primary -> kilo-alternate _ |
Code Review Roast 🔥Verdict: No Issues Found | Recommendation: Merge Oh wait, this PR is actually clean. I need to sit down. I had my flamethrower warmed up and everything. Round 3, and the streak holds: the single finding from the previous review (the anchored 📊 Overall: Like a locksmith who installed the vault door and bought a differently-shaped key to test it with. The one residual gap is unchanged from last run: Files Reviewed (2 files, incremental at HEAD 0ffe057; PR diff = 14 launcher files vs base 6d17926)
Previous Review Summaries (3 snapshots, latest commit edf167b)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit edf167b)Verdict: 1 Issue Found | Recommendation: Address before merge Fix these issues in Kilo Cloud Overview
Issue Details (click to expand)
🏆 Best part: Both prior review findings were answered and actually fixed at HEAD — the detector is anchored, empty 💀 Worst part: The fix's own regex swung from too loose to slightly too strict. The launcher's entire job is that one classification, and the one untested help format (short flag + metavar) would silently starve a legacy CLI of its config — no crash, no warning, just a session quietly missing its MCP servers. 📊 Overall: Like a locksmith who replaced the flimsy lock with a vault door — excellent, right up until a customer with a differently-shaped key shows up.
Files Reviewed (14 files, full diff at HEAD edf167b)
Previous review (commit 3e5c1a6)Verdict: 2 Issues Found | Recommendation: Address before merge Fix these issues in Kilo Cloud Overview
Issue Details (click to expand)
🏆 Best part: The SPARK-KIMI roster wiring is genuinely tidy — 💀 Worst part: The cwd-binding block. The deletion of 📊 Overall: Like renovating a house for sale by tearing out the shared plumbing and installing two identical copies of it — works today, and the second plumber will be very confused.
Files Reviewed (13 files, incremental since 55afc84)
Previous review (commit 55afc84)Verdict: 1 Issue Found | Recommendation: Address before merge Fix these issues in Kilo Cloud Overview
Issue Details (click to expand)
🏆 Best part: Oh wait, this part is actually clean. 💀 Worst part: The 📊 Overall: Like fixing a haunted house by burning it down and rebuilding — solid structure, but the new smoke detector is a guy sniffing the air. Ship it after one honest anchor on that grep. Files Reviewed (5 files)
Reviewed by glm-5.3-flash · Input: 83.7K · Output: 6.5K · Cached: 659.8K |
Identity: kimi-pmoves on spark launched unbound ("no identity is declared
for harness 'kimi'"). The roster already names SPARK-KIMI (canonical
spark-kimi in identity_vocabulary.yaml); it had no registry key and the spark
node declared no default_identity. Adds kimi_spark to agent_registry.yaml
(shape of kimi_knuckles, affinity spark), spark.default_identity.kimi in
node-vocabulary.yaml, the kimi_spark spelling to the spark-kimi roster entry,
and the orchestration team. No cipher_agent_id: no card is minted for
spark-kimi, and every declared id must name an active card.
Regenerated deploy/provision with pmoves_launcher_generator.py, which adds
the registry-driven kimi-pmoves-spark pin, as claude has per-node pins.
Launchers: the cwd binding is inlined in kimi-pmoves.sh and kilo-pmoves.sh
instead of sourced from a separate pm-launch-cwd.sh, which is removed.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Fleet review: kilocode (zai-coding-plan/glm-5.3)reviewer: tier 2/3 Reviewed 1. CORRECTNESS
2. SECURITY / TOPOLOGY
3. VERDICT: REQUEST_CHANGESThe launcher fix itself is sound and tested, but ~9 files adding the reviewer chain
_ lane: fleet-review chain (self-hosted kvm4) - spark-local (when online) -> kilo-primary -> kilo-alternate _ |
… twin-locked cwd block; resolver in the test CI (python-tests ratchet) had one new failure: test_no_repo_python_spawns_a_bare_bash -- the launcher test spawned ["bash", ...], which on Windows is the System32 WSL stub. It now spawns resolve_bash(), like the other launcher tests. main merged in to pick that gate up. Review (kilo) on kimi-pmoves.sh:90 -- grepping `kimi --help` for the substring `--config-file` flips to the legacy path the moment Kimi Code MENTIONS the flag anywhere, and an empty/failed --help fell open into the Kimi Code branch. Now: the help text is captured once; the match is anchored to a flag-definition line (`--config-file` at line start, optionally after a short flag, followed by space/=/,/EOL); empty output is an explicit exit 1 naming the install, never a guess. Two tests pin both: prose mention stays Kimi Code, empty help is refused. Review (kilo) on kilo-pmoves.sh:72 -- the cwd binding is an inline twin in both launchers while the header doctrine says fragments. The inline is deliberate: the binding must hold on a checkout with no fragments present (the launcher may be the first thing that runs there), which a sourced file cannot promise. Kept inline, made non-driftable instead: both blocks carry a `pm-cwd-bind` marker and test_cwd_binding_blocks_are_twins asserts they are byte-identical modulo the launcher tag, so a change to one fails until the other matches. Local: bash -n clean on both scripts; test_no_bare_bash_argv 26 passed; the three new launcher tests pass. The four pre-existing cwd-asserting launcher tests fail on Windows only because Git Bash `pwd -P` reports /c/... while the test expects C:\... -- unchanged by this commit and green on the Linux runner. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Fleet review: kilocode (zai-coding-plan/glm-5.3)reviewer: tier 2/3
reviewer chain
_ lane: fleet-review chain (self-hosted kvm4) - spark-local (when online) -> kilo-primary -> kilo-alternate _ |
# Conflicts: # pmoves/configs/node-vocabulary.yaml
…re the comma Review (kilo) on kimi-pmoves.sh:105: the anchored match demanded the comma directly after the short flag (`-c, --config-file`). argparse renders `-c CFG, --config-file CFG`, so a real legacy kimi-cli with that help text was classified as Kimi Code and exec'd WITHOUT --config-file: the original misroute, mirrored, and quieter because the legacy CLI then starts with none of its .kimi/ config instead of dying on an unknown option. The optional short-flag group is now `-[A-Za-z][^,]*,` so a metavar may sit between the flag and the comma. Prose that merely mentions the flag still does not match (it does not start with `-`), so the deprecation-note discipline from the previous commit holds. Checked directly against five help-line shapes: `-c CFG, --config-file CFG`, `-c, --config-file FILE` and `--config-file FILE` route legacy; a prose mention and `--config-file-legacy` route Kimi Code. New test test_legacy_kimi_cli_with_short_flag_and_metavar_is_still_legacy feeds the argparse rendering and asserts the legacy branch adds --config-file. On Windows it fails the same way as the existing legacy test (Git Bash reports /c/... where the test expects C:\...); index 0 of argv is --config-file on both, so the routing is correct and the Linux runner is the gate. main merged in (b602954); node-vocabulary.yaml took both spark default_identity keys. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Fleet review: kilocode (zai-coding-plan/glm-5.3)reviewer: tier 2/3
reviewer chain
_ lane: fleet-review chain (self-hosted kvm4) - spark-local (when online) -> kilo-primary -> kilo-alternate _ |
Conflict in deploy/provision/launchers.manifest.json resolved by regenerating with pmoves_launcher_generator.py (generator output, never hand-merged); launchers-drift-check: all 63 generator files match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ls (windows-encoding-ratchet) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
On a Linux node with current CLIs, both launchers failed or ran the wrong program:
--config-file/--mcp-config-file. Those flags exist only in the legacy Pythonkimi-cli. Kimi Code (>= 2.x, which installs askimi) exits witherror: unknown option '--config-file'before any session starts.make -C pmoves kimihad the same flags inline.opencode --config pmoves/configs/claws/opencode-<node>.json:opencodedoes not readkilo.json.--configflag, so the flag was silently ignored.mcpServerskey. opencode rejects that withUnrecognized key: mcpServerswhen the file is supplied viaOPENCODE_CONFIG.$1was always taken as the node name and defaulted to5090on every node, sokilo-pmoves --versionfailed withConfig not found: .../opencode---version.json..mcp.json,kilo.json,AGENTS.md) and key "continue last session" by cwd. A launch from a sibling checkout therefore ran against that checkout's files.Change
.claude/worktrees/*, is kept.PMOVES_LAUNCH_KEEP_CWD=1opts out.kimi-pmoves.shaskskimi --helpwhether--config-fileexists:~/.kimi-code/{config.toml,mcp.json}and<repo>/.mcp.json)..kimi/flags.kilo-pmoves.shrunskilo(falling back tokilocode) with args passed through unchanged. A leading node name that matches a claws file is still accepted and dropped, with a notice, so old invocations keep working.no identity is declared for harness 'kimi'), although the roster already names SPARK-KIMI (spark-kimiinidentity_vocabulary.yaml). This PR:kimi_sparktoagent_registry.yaml, shaped likekimi_knuckles, with affinityspark;spark.default_identity.kimi: kimi_sparktonode-vocabulary.yaml;kimi_sparkspelling to the roster entry and to the orchestration team.The launcher now reports
identity=kimi_spark. Nocipher_agent_idis declared, because no signing card is minted for spark-kimi.deploy/provisionwas regenerated withpmoves_launcher_generator.py, which adds the registry-drivenkimi-pmoves-sparkpin (claude already has per-node pins).kimidelegates tokimi-pmoves.sh, andkilo-pmovesno longer forces5090.pmoves/tests/scripts/test_kimi_kilo_launchers.pyruns each launcher from outside the repo with stub CLIs on PATH and asserts on the argv and cwd the stub saw.Not in this PR
.kimi/mcp.jsonis not wired into Kimi Code. Kimi Code has no MCP-file flag and does not expand${VAR}in headers (it usesbearerTokenEnvVar), so that needs a converter, not a flag.opencode-*.jsonfiles are left as-is.Test
python3 -m pytest pmoves/tests/scripts/test_kimi_kilo_launchers.py pmoves/tests/scripts/test_launcher_carry_parity.pyplus the identity, registry and launcher-generator suites give 242 passed, 2 skipped. A live--versionprobe of both launchers against the real CLIs prints the version and exits 0.🤖 Generated with Claude Code