Add Kimi Code V1 harness#1675
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3628ec4205
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ApprovabilityVerdict: Needs human review This PR introduces a new harness integration with non-trivial installation and invocation logic. Additionally, there is an unresolved high-severity review comment identifying that headless runs may hang due to missing tool permission overrides. You can customize Macroscope's approvability policy. Learn more. |
| "KIMI_MODEL_BASE_URL": endpoint, | ||
| "KIMI_MODEL_CAPABILITIES": "tool_use", | ||
| "KIMI_DISABLE_TELEMETRY": "1", | ||
| "KIMI_CODE_NO_AUTO_UPDATE": "1", |
There was a problem hiding this comment.
Wrong auto-update env var
Medium Severity
The harness sets KIMI_CODE_NO_AUTO_UPDATE, but Kimi Code reads KIMI_CLI_NO_AUTO_UPDATE to disable startup update checks and gates. With the wrong name, headless rollouts may still run update logic during launch, adding latency, network calls, or interactive blocking in pinned installs.
Reviewed by Cursor Bugbot for commit 47140a7. Configure here.
There was a problem hiding this comment.
|
|
||
| mcp = {"mcpServers": {name: {"url": url} for name, url in mcp_urls.items()}} | ||
| await runtime.write(f"{KIMI_HOME}/mcp.json", json.dumps(mcp).encode()) | ||
| return await runtime.run([BINARY, "--prompt", instruction], env) |
There was a problem hiding this comment.
Headless run lacks tool approvals
High Severity
The harness invokes kimi with only --prompt and no permission override, while SUPPORTS_TASK_TOOLS is true. Non-interactive --prompt defaults to auto permission, which still requires approval for write and shell tools, unlike Codex and Claude Code bypass flags—agentic rollouts can hang or fail when tools run.
Reviewed by Cursor Bugbot for commit 47140a7. Configure here.
There was a problem hiding this comment.
…-code-harness # Conflicts: # packages/harnesses/harnesses/__init__.py # tests/v1/conftest.py
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
There are 5 total unresolved issues (including 2 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit aef0057. Configure here.
| set -e | ||
| bin="/tmp/vf-kimi-code/bin/kimi" | ||
| if [ -x "$bin" ] && [ "$("$bin" --version 2>/dev/null)" = "{version}" ]; then | ||
| exit 0 |
There was a problem hiding this comment.
Install version check mismatch
Medium Severity
The install short-circuit compares raw kimi --version stdout to the config semver string 0.14.3. Kimi Code’s own preflight/update logic normalizes version strings differently, so this equality often fails and every rollout re-downloads and re-runs the installer even when the pinned binary is already present.
Reviewed by Cursor Bugbot for commit aef0057. Configure here.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aef00576a9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…-code-harness # Conflicts: # tests/v1/conftest.py


Overview
Adds Kimi Code as a built-in V1 code-agent harness alongside the existing agent harnesses.
Details
Stack
This PR targets
feat/nano-as-v1and is stacked on #1576.Note
Medium Risk
Rollouts download and execute an external installer and pass the rollout session secret into the agent environment, but behavior matches existing agent CLI harnesses rather than changing core auth.
Overview
Adds Kimi Code as a built-in V1 agent harness (
kimi-code), in the same family as Codex and RLM.On rollout, the harness installs a pinned Kimi CLI (default
0.14.3) via the upstream install script (withflockand a version short-circuit), wires the V1 interception endpoint and rollout secret throughKIMI_MODEL_*env vars as an OpenAI-compatible provider, writes task MCP servers to an isolated.vf-kimi-code/mcp.json, and runskimi --promptheadlessly. It advertisesSUPPORTS_TASK_TOOLSand does not append a system prompt.The harness is re-exported from
harnessesand included in the shared v1 e2e harness matrix under theslowmarker.Reviewed by Cursor Bugbot for commit cac312e. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add KimiCode harness for running Kimi Code CLI as a coding agent
harnesses/kimi_code/withKimiCodeHarnessandKimiCodeHarnessConfig(default version0.14.3, idkimi-code)./tmp/vf-kimi-codevia a flock-guarded shell script using the upstream curl installer, then runs it headlessly with--prompt.mcp.json.kimi-codeto theharnessfixture intests/v1/conftest.pyas apytest.mark.slowentry.ProgramErrorwith a stderr tail, but network or version availability issues at runtime could cause flaky test results.Macroscope summarized cac312e.