Closed
Labels
enhancementNew feature or request
Description
This was generated by AI during a grill-with-docs session.
Idea
Add a Kimi CLI Harness, so Kimi K3.1 Pro served by Fireworks can be a seat on the Grader panel of Spec #1872, and later an Arm or a Ticket run's Harness. Decided in docs/grill-with-docs/1484-implement-suite.md (Q6.4 (b), Q7.1, Q7.2), against the recommendation to use opencode. Research: docs/research/eval-grader-panel.md §1.
What's known
- Kimi CLI runs headless (
--print,stream-json), but its docs say nothing about token usage in its output. - An adapter is about 1,000 lines: setup, sandbox provider hosts, sign-in or API key, usage, session traces and interpretation.
Decided
- Check first. The work starts by checking Kimi CLI's real headless output. If it reports usage, use that. If not, the Harness estimates usage from the transcript's characters, priced from the frozen price table and labelled estimated in every report, and the panel's spending limit counts the estimate (Q7.1).
- It's its own issue, built and tested like the other Harnesses. Spec: blind pairwise grading of process Trials by a Grader panel and people #1872's panel waits on it only for Kimi seats (Q7.2).
For triage
Whether this is one Ticket or needs a Spec, and whether the Fireworks host it needs comes from #1883 or from this issue.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
JacobStephens2 commentedon Nov 9, 2026
Agent Brief
Category: enhancement
Summary: Add a
kimiHarness running Kimi Code CLI headless, so a Model such as Kimi K3.1 Pro on Fireworks can run a Command's sessions and later sit on #1872's Grader panel.Triage findings (2026-11-09):
MoonshotAI/kimi-cli, 1.52.0) is archived and its README points to Kimi Code CLI (MoonshotAI/kimi-code, npm@moonshot-ai/kimi-code, 2.5.2, MIT). Kimi Code CLI installs the samekimibinary. Build against Kimi Code CLI.kimi -p … --output-format stream-jsonwrites Assistant and Tool messages but no usage. The session's own record does include it: eachstep.endevent in<KIMI_CODE_HOME>/sessions/…/agents/main/wire.jsonlcarriesusage(inputOther,output,inputCacheRead,inputCacheCreation).KIMI_CODE_HOMEdefaults to~/.kimi-code, and Kimi's own vis tool sums usage from those events. That replaces the grill's Q7.1 plan to estimate usage from characters.base_url(kimi provider import … --base-url,config.tomlproviders, orKIMI_MODEL_*environment variables).Current behavior:
The Harnesses are claude, codex, agy, grok, muse and opencode. Kimi Models run only through opencode, and the sandbox proxy's provider hosts include no Fireworks host.
Desired behavior:
harness kimiruns a Command's sessions on Kimi Code CLI wherever the other Harnesses can be chosen, including[harness.kimi]and Setup, like the grok Harness (#437).kimi -p <prompt> --output-format stream-jsonwith stdin null. Non-interactive mode already approves automatically, and--yolocan't be combined with-p. The session gets its ownKIMI_CODE_HOME, or a known one, so that itswire.jsonlcan be found.kimi --session <id>(alias-r). The Harness gets the session id from Kimi's output or its session folder.step.endusage events in the session'swire.jsonl, by Model, mapped onto thirdshift's usage fields with cache reads and writes kept apart.AGENTS.md. The Harness's docs say which instruction files and skill folders it reads.api.fireworks.ai) is added as a provider host in this Ticket. Allow Fireworks and Baseten through opencode, with a key per provider #1883, a Ticket inside Spec Spec: blind pairwise grading of process Trials by a Grader panel and people #1872, reachesmainonly when that Spec merges, so this Ticket must not wait for it. Whichever of the two lands second finds the host already there. The Kimi Code sign-in hosts are allowed when the session uses the managed Kimi provider.wire.jsonl.Key interfaces:
Harnessenum and its adapter: a newKimivariant with namekimi.[harness.kimi]config: Model, provider, and the name of the API-key environment variable.Acceptance criteria:
harness kimiruns a Command's session, using the fake-Harness test pattern the other Harnesses use. The session runskimi -pwith--output-format stream-json, stdin null, and a setKIMI_CODE_HOME.step.endusage events in itswire.jsonl, across several steps, with input, output, cache-read and cache-write tokens kept apart. A session with nostep.endusage reports usage as missing, not zero.kimi --session <id>with the first session's id.api.fireworks.aiand nothing else through the proxy. The existing check that each Harness gets only its provider's hosts covers kimi.kimiis installed.kimirun'swire.jsonlis checked to have thestep.endusage shape above. If the shape has changed, the parser follows the real output and a test fixture records it.Out of scope:
[-]Add a Kimi CLI Harness[/-][+]Add a Kimi Code CLI Harness[/+]Merge pull request #1909 from JacobStephens2/grill-1484-kimi-usage