Add the kimi CLI as a /kickoff worker agent - #51
Conversation
kimi-code has no positional launch prompt, no initial-prompt env var, and piped stdin only prefills the input box without submitting (and would steal the TUI's tty). `-p` is the only way in, but it is mutually exclusive with both --auto and -y and exits after one answer. It does run tools unattended though, and `kimi -c` inherits its full session history — so the worker launches in two phases: `-p` seeds and works the task one-shot, then `exec kimi -c --auto` takes over as the interactive autonomous session with that history. All probed live against kimi-code 0.31.1. - Registry: --kimi -> kimi:kimi-code/k3-256k (commit,pr). The model id must be the QUALIFIED alias; the bare name aborts at startup like an unknown model. - Readiness is model-aware (grok precedent) via `kimi provider list --json`, bounded. Auth probes credentials/, not the same-named oauth/ dir — that file stays 0 bytes even when logged in. `kimi doctor` only validates config syntax. - A well-formed listing offering no models means unavailable; a document without the `models` section is drift and falls back to trusting auth. - Values ride as "$1"/"$2" positionals, never spliced into the script text: `-p` swallows the next token, so a concatenated argv is one reordering away from silently eating a flag. - Tests assert the exact word list plus that structure, and execute the resolved argv against a logging stub to check what each phase received. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SkXCG4uaXDEyf3ciKYKu2i
Completes the kimi worker surface started in the registry commit. - /continue: the reopen caveat now names `kimi -c` alongside `codex resume --last` / `grok -c`. Reopen still always sends `claude -c` (the worker isn't persisted per task), so the caveat stays inline. - /kickoff: --kimi in the flag list, kimi in the non-claude announce class, and the manual launch block spells out the two-phase form. Called out that shell-quoting is load-bearing there: one argv word is a script carrying `;`, `$` and quotes, so an unquoted render would run the `;` in the user's own shell and expand $1/$2 there. - Lifecycle verified rather than assumed: agent_name comes from the registry's `name=` and agent_status from herdr's pane hooks, so nothing reads argv[0] and the `sh -c` wrapper (which execs into kimi) leaves tab teardown and state detection unchanged. - Docs: both READMEs, marketplace description, CHANGELOG, and the kickoff-agent-selection knowledge entry, which records the launch-shape constraints and why grok's "empty listing = inconclusive" rule had to be re-derived for JSON. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SkXCG4uaXDEyf3ciKYKu2i
🐝 Swarm review (local ensemble) · reviewed at e534812PR #51: Add the kimi CLI as a /kickoff worker agent
Finding 1 (das einzige critical) wurde in der Session live widerlegt: der Mechanismus lautete 'kimi -c continues the globally most-recent session', aber -c ist cwd-scoped (kimi --help: 'for the working directory'). Gegenprobe: in einem älteren Session-Verzeichnis resumierte -c dessen eigene Session, obwohl die global jüngste Session woanders lag. Zwei Worktrees = zwei cwds, das Parallel-Kickoff-Szenario existiert nicht. Berechtigter Restpunkt: kein Test deckt einen fehlschlagenden Seed ab. 3 weitere Findings wurden vom Verifier refuted, darunter die Behauptung, herdr sehe wegen des sh -c-Wrappers agent=sh — durch einen echten herdr-Probe-Pane widerlegt (agent=claude bereits während der Pre-exec-Phase). Findings 2, 4, 5, 9, 12, 13, 17 sind dasselbe Versäumnis: Skill-Bodies wurden nachgezogen, die Aktivierungsflächen (Frontmatter-Descriptions, Argument-Tabellen) und /adopt nicht. Lokaler Swarm-Review (Claude-Lenses + codex + grok), keine Backend-Fehler, keine Redactions. Local mixture-of-agents review (Claude lenses + codex + grok) run from the author's machine — not a hosted bot. Verdicts (✅/🟨/❌) are the runner's own assessment. |
Follow-up to the swarm review on PR #51: the first pass updated skill bodies but missed the activation surfaces and /adopt entirely, while README claimed /adopt takes the same worker flags. - /kickoff: frontmatter description + flag table; /adopt: both selector enumerations + the manual-launch block, incl. the load-bearing `sh -c` quoting caution; /close: worker-degradation prose reads "non-claude" - herdr-launch.sh usage header, plugin.json description, CLAUDE.md plugin line (v1.11.x), and the herdr-kickoff-automation knowledge entry, which documented only the codex/grok `-m` argv - /kickoff's non-claude announce rule now tests "not `claude:`" rather than a codex:/grok:/kimi: allowlist that needs a hand-edit per new CLI - Drop the dead `-z` arm in the kimi probe: empty output already fails the `"models"` grep and lands in the same branch Not applied (kept in the review for the record): the `critical` finding claimed `kimi -c` resumes the globally most-recent session. It does not — `-c` is cwd-scoped (verified live: in an older session's directory `-c` resumed that directory's session while the newest session lived elsewhere), so two worktrees cannot cross-resume. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SkXCG4uaXDEyf3ciKYKu2i
Second swarm round on PR #51. Applied the agreed findings: - A failed seed no longer passes unnoticed. `&&` would kill the pane and a bare `;` let the error scroll away behind the TUI's first repaint, leaving a tab that looked like a working worker but never read TASK.md. It now reports and waits for a keypress before handing over. Verified live that a failed seed in a fresh worktree opens a NEW empty session, never a foreign one — `kimi -c` is scoped to the working directory. - `resolve` emits `argv_shell=`: the argv words POSIX-single-quoted by the registry. /kickoff and /adopt print it verbatim rather than re-deriving quoting from a prose rule — for kimi a mis-quote would run the `;` in the user's own interactive shell. Uses shell_quote, not `printf %q`, which on bash 3.2 emits per-character backslashes and `$'…'` for non-ASCII: correct but unreadable before pasting, and bash/zsh-only. The seed message is ASCII-only for the same reason. - The model check matches the alias in KEY position, so it can't fire on the alias appearing as a value while `models` is empty. The real document is flat-qualified (verified live), which also refutes the nested-schema half of that finding. - Tests: the previously untested failing-seed path, plus the argv_shell shape; the "prompt not spliced" check compares the whole prompt word now that the script text legitimately mentions TASK.md. - Stale pointers/enumerations: adopt + kickoff cited "/kickoff step 12" for a launch form living in 13b; manager-worker-orchestration and the knowledge index still listed the pre-kimi worker set. The selector hint is derived from REGISTRY instead of restated. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SkXCG4uaXDEyf3ciKYKu2i
Outcome of the security finding both swarm rounds raised: kimi is the only worker that acts without tool-approval prompts. Kept deliberately — the seed cannot have approvals (`-p` refuses --auto/-y and is the only way to deliver the task), and dropping --auto from phase 2 would leave the phase that does the work just as unattended. Mitigation is visibility, matching the existing announce-not-prompt precedent: - /kickoff states the unattended start whenever the worker resolves to kimi, by flag, repo default or picker alike - /adopt warns additionally: its TASK.md is summarized from another branch's commits, so it is the one path where an unattended worker acts on content the user did not write - README says plainly what the autonomy costs; the knowledge entry records the decision and what a future revisit should change (a second registry entry, not the --auto flag) Also sync the launch form in README/CHANGELOG/knowledge with the seed-failure handler added last commit — the docs still showed the bare `;` variant, which is the same doc drift the review flagged twice. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SkXCG4uaXDEyf3ciKYKu2i
Summary
/kickoffworker alongside claude/codex/grok:--kimi→kimi:kimi-code/k3-256k.<cli> -m <model> <prompt>launch form, so it launches in two phases — every constraint behind that shape was probed live against kimi-code 0.31.1, not inferred from docs.-mid aborts kimi at startup — a stale model would otherwise hand the user a worker tab that dies on sight.Changes
Registry + launch argv (
agent-registry.sh)--kimi | kimi | kimi-code/k3-256k | commit,pr. The model id must be the qualified alias; the bare name is rejected exactly like an unknown model.sh -c 'kimi -m "$1" -p "$2"; exec kimi -c --auto' kimi-worker <model> <bootstrap>. Rationale: kimi has no positional launch prompt (kimi "text"→ "unknown command"), no initial-prompt env var, and piped stdin only prefills the input box without submitting (and would steal the TUI's tty in a pane).-pis the only entry point but is mutually exclusive with both--autoand-yand exits after one answer. It does run tools unattended, andkimi -cinherits its full session history — so the seed works the task through once, thenexechands over to the interactive autonomous session.execre-roots the herdr pane at kimi;;(not&&) keeps phase 2 alive if the seed fails, leaving a usable tab.kimi provider list --jsonfor the model, plus an auth probe oncredentials/kimi-code.json— not the same-namedoauth/file, which stays 0 bytes even when logged in.kimi doctoronly validates config syntax and is not an auth check.modelssection is treated as format drift (trust auth); a well-formed listing offering nothing means unavailable. grok's "empty output = inconclusive" rule does not transfer to JSON, where{"models": {}}is non-empty but a real answer.Tests (
test_agent_registry.py)-pconsumes the next token, so a concatenated argv is one reordering away from silently eating a flag (kimi -p --auto "…"turns--autointo the prompt). The model and prompt therefore ride as"$1"/"$2"positionals, never spliced into the script text — asserted structurally, plus the exact word list.Skills, lifecycle, docs
/continue: the reopen caveat now nameskimi -cnext tocodex resume --last/grok -c(reopen still always sendsclaude -c; the worker isn't persisted per task)./kickoff:--kimiin the flag list, kimi in the non-claude announce class, and the manual launch block documents the two-phase form — including that shell-quoting is load-bearing there, since one argv word is a script carrying;,$and quotes.agent_namecomes from the registry'sname=andagent_statusfrom herdr's pane hooks, so nothing readsargv[0]and thesh -cwrapper leaves tab teardown and state detection unchanged.kickoff-agent-selectionknowledge entry.Readiness
test_agent_registry.pypasses;check-structure.py0 errorsplugin.json+marketplace.jsonin synckickoff-agent-selection.mdupdated (launch-shape constraints + the JSON/empty-listing distinction)Test plan
bash plugins/work-system/scripts/agent-registry.sh listshowskimi:kimi-code/k3-256kas available/kickoff <task> --kimiopens a worktree tab; phase 1 works the task, phase 2 lands in an interactiveautosession carrying that history/closeon a kimi worker tab tears it down (Scenario A) — not yet exercised live; only the code paths were verifiedagent-registry.sh resolve --kimiwith a bogus model in the registry reports unavailable instead of launching🤖 Generated with Claude Code
https://claude.ai/code/session_01SkXCG4uaXDEyf3ciKYKu2i