Repository navigation
Add the Kimi Code Harness - #1923
Merged
Merged
Conversation
Sessions run kimi -p --output-format stream-json with stdin null and a set KIMI_CODE_HOME; usage is the total of the session's wire.jsonl step.end events by Model alias, with cache reads and writes kept apart. Models are checked against kimi provider list --json, a Trial's proxy allows only the alias's provider hosts (api.fireworks.ai for Fireworks), and Setup offers kimi when it is installed.
- Link AGENTS.md to a CLAUDE.md-only worktree, as for OpenCode (ADR-0013). - Find a failed turn's session folder by its prompt, and count only the turn this session started when a Resume appends to the same record. - Add Fireworks to the shared provider host table. - Share Kimi's home files, drop the duplicate stream fixture, and fix stale Harness lists in the guide and eval docs.
This was referenced Nov 10, 2026
Merged
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.
Summary
A new Harness,
kimi, runs a Command's sessions on Kimi Code CLI (@moonshot-ai/kimi-code2.5.2), wherever the other Harnesses can be chosen:harness kimi,[harness.kimi],harness.defaultand Setup.kimi provider list --jsonbefore any work (no tokens); a bad alias fails naming the configured ones. Kimi has no Effort flag, so any Effort fails before work.config.tomlwithapi_key_env = "FIREWORKS_API_KEY", so the key stays in the environment, never in a repository (documented in the guide). A sandboxed kimi Trial on that Model getsapi.fireworks.aiand nothing else;api.fireworks.aiis also in the shared provider table asfireworks-ai, so Allow Fireworks and Baseten through opencode, with a key per provider #1883 finds it there.--agent-filewith an agent whosetools: []and whose instructions are the release input.docs/trial.md,docs/eval-tasks.md,site/index.html,site/architecture/,site/llms.txt.Evidence
Execution evidence
cargo test --test kimi_sessions: 7 passed. A Run onharness kimi model kimi-k3.1-prorunskimi --output-format stream-json -m kimi-k3.1-pro -p …with stdin null andKIMI_CODE_HOMEset; usage across threestep.endevents is16713 input tokens (14592 cache read, 576 cache write), 250 output tokens; a session with nostep.endusage shows no usage line;model kimi-k9fails before any Claim or worktree namingkimi-code/kimi-for-coding, kimi-k3.1-pro; a failed turn still reports its usage.cargo test --test process_tree kimi: interrupting a kimi Run stops a command in its own session, and interrupting the live catalog check stops before work.cargo test --bin thirdshift harness::kimi: 20 passed, including the Resume (--session <id>with the hinted id, same flags, null stdin) andproxy::tests::each_harness_allows_only_its_provider_hostscovering kimi on a Fireworks Model (["api.fireworks.ai"]).cargo test --bin thirdshift harness::kimi→test result: FAILED. 17 passed; 3 failed(claude_only_instructions_are_linked_as_agents: NotFound;a_turn_without_the_resume_hint_still_reports_its_wire_usage;wire::tests::a_resume_counts_only_its_own_steps)cargo test --bin thirdshift harness::kimi→test result: ok. 20 passed; 0 failedscripts/affected-tests main→PASS npm test --prefix site,PASS cargo build --locked,PASS npm test --prefix console; itscargo testfailed threetests/process.rsfindings::*Security tests under load, which pass alone on this branch (cargo test --test process findings→ 19 passed) and onmain. The whole suite then passed withcargo test --no-fail-fast(exit 0, 99 test binaries ok).cargo clippy --all-targetsclean;npm run docs:check --prefix siteclean.kimirun. No Fireworks or Kimi credentials were available here, and running the downloaded Kimi Code CLI against a local stub provider was refused by this session's permission policy. Thestep.endusage shape and stream lines come from reading Kimi Code 2.5.2's published bundle (finishMachineStepProjectionwritesstep.endwithusageinsidecontext.append_loop_event;PromptJsonWriter;writeResumeHint);tests/fixtures/kimi-wire.jsonlis reconstructed from that source and says so. See Unaddressed findings, P2.Visual evidence
Architecture diagram, desktop 1440×900 (Agent session box now lists kimi):
Architecture diagram, mobile 390×844:
Home page Requirements, desktop 1440×900:
Home page Requirements, mobile 390×844:
Merge Danger
Door: two-way
A new, opt-in Harness. Nothing runs on kimi unless a command or the User config chooses it.
Blast Radius: small
Shared edits:
Adapter::prepare(a no-op default) in the Harness launch helpers, afireworks-aientry in the proxy's provider table (OpenCode Trials naming that provider now pass the host check), and a[harness.kimi]section in Setup's written User config.Review
Standards: 10 findings; Spec: 7. Both reviewers read every changed file except
site/docs/index.html, generated fromdocs/guide.mdand confirmed by both withnpm run docs:check --prefix site(clean), so it was left unread on purpose. Addressed: S1 (AGENTS.md link, ADR-0013), S2/P6 (duplicate fixture removed), S3 (sharedHOME_FILES), S5 (accumulate,input_including_cache), S6 and S7 (doc fixes), S9 (panic message), S10 (stale Harness lists), P1 (failed-turn usage via the session folder), P5 in part (Fireworks in the shared table), P7 (Resume counts only its turn), and P2's fixture metadata (protocol_version: "1.5").Unaddressed findings
Standards
kimi provider listtwice). Declined:proxy::allowed_hosts(harness, model)is the shared per-Harness entry the sandbox calls for every Harness, andkimi_intoruns earlier insandbox::prepare's home step; sharing one read would thread Kimi state through the sharedRequest. The extra read is a free local CLI call (src/proxy.rsHarness::Kimi => kimi_trial_hosts(model, Catalog::read)?).Catalogkeeps raw JSON). The doc-comment part is fixed; the typed model is declined:provider()is the only reader, and Kimi's config schema has many optional, aliased fields (provider/providerId, model- or provider-levelbaseUrl,oauth) that it reads in one place (src/harness/kimi/catalog.rsfn provider).Kimi::summary). Declined: theAdapter::summarycontract requires the input travel by stdin or a file besideprompt_file, which "remains available until the CLI exits" (src/harness/adapter.rs); Kimi's-preads neither, and an agent file is its only way to remove every tool. A failed write fails the session, and the release falls back to generated notes (src/harness/summary.rs).proxy.rs/sandbox.rs/triage.rs). The duplicated list is fixed; moving Trial logic behind the adapter is declined here: every Harness's Trial hosts and homes already live in those three matches, and changing that is an architecture change beyond this Ticket.Spec
kimirun'swire.jsonlnot checked). Not done in this session: no credentials, and running the downloaded CLI against a local stub was refused by the session's permission policy. The shape follows Kimi Code 2.5.2's source as above. Filed for the Day shift: Check a real kimi run's wire.jsonl against the Kimi Harness's usage parser #1925[harness.kimi]has no provider or API-key-variable keys). Declined, because the Spec's Key interfaces must decide: the provider and itsapi_key_envlive in Kimi Code's ownconfig.toml, which Kimi already reads and validates; thirdshift reads them fromkimi provider list --json(src/harness/kimi/catalog.rsProvider { base_url, api_key_env }). Adding them to[harness.kimi]would make two sources for one setting. Filed: Should [harness.kimi] carry the Kimi provider and its API-key variable? #1924src/session.rsif let (false, Some(session_id)) = (ended.killed.is_empty(), …)), and Kimi's print mode waits for or steers its own background work and reports none killed (applyPrintBackgroundPolicy, defaultsteer), as with Grok (guide).harness::kimi::tests::a_resume_uses_the_hinted_session_id_with_the_same_flags_and_null_stdinpasses.kimi_intokey forwarding and the npm package bind untested). Declined here: both need a realkimionPATH(Catalog::read) and bwrap; the host decision they feed is covered byproxy::tests::each_harness_allows_only_its_provider_hostsanda_kimi_trial_allows_only_its_models_provider_hosts, which pass.Closes #1888
Built with claude 2.1.314 · opus · default effort
Security review outcome
No unaddressed introduced findings.
CI notes
console-test(run 42729950160):console/tests/logs.test.cjs"a live Session appends without redraw…" timed out after 5 s waiting for the final unterminated line to drain. This branch changes neitherconsole/nor the Console's log streaming. The test passed 3 times on its own and the full suite passed 168/168 locally on this branch, so the failure looks intermittent.