Skip to content

fix(source-control): drop Kimi flags Kimi Code rejects (--quiet, --thinking) - #33285

Merged
nwparker merged 2 commits into
mainfrom
nwparker/agint-14771-kimi-quiet
Oct 24, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/agint-14771-kimi-quiet

Conversation

@nwparker

@nwparker nwparker commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​15 $\color{#cf222e}{\Huge{\mathbf{−}}}$​29 $\color{#cf222e}{\Huge{\mathbf{−}}}$​14
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4 $\color{#cf222e}{\Huge{\mathbf{−}}}$​14 $\color{#cf222e}{\Huge{\mathbf{−}}}$​10

ELI5

When Kimi is the Source Control AI agent, Orca launches kimi with flags the current Kimi CLI doesn't have (--quiet, and --thinking/--no-thinking when the Kimi K2.6 model is picked). The CLI stops with error: unknown option '--quiet' before it reads the prompt, so generating branch names and commit messages always fails. This PR passes only the flags Kimi accepts.

Root cause (upstream refs)

There have been two different CLIs that install a binary called kimi:

  • Legacy Python kimi-cli (MoonshotAI/kimi-cli, now archived). Up through 1.50 it accepted --quiet as an alias for --print --output-format text --final-message-only (src/kimi_cli/cli/__init__.py:277-283, :417-430) and --thinking/--no-thinking (:181-187). --prompt alone opened the interactive shell, so --quiet was required there. Since 1.51/1.52, every entry point is short-circuited to a deprecation notice that exits 0 (src/kimi_cli/__main__.py:28-46, src/kimi_cli/deprecation.py). With any of our argv, legacy kimi-cli can no longer generate anything.
  • Kimi Code CLI (MoonshotAI/kimi-code, the successor; kimi/kimi-code). Its commander program sets allowUnknownOption(false) (apps/kimi-code/src/cli/commands.ts:35), and the only headless flags it has are -p, --prompt <prompt> ("Run one prompt non-interactively and print the response", :62-67), -m, --model (:56-61) and --output-format text|stream-json (:68-74). Its CLI source has never contained --quiet, --thinking or --print (git log -S over apps/kimi-code/src/cli returns nothing for each).

#11674 switched the recipe to --prompt, but it kept the legacy --quiet and --thinking/--no-thinking.

What changed

  • Kimi recipe argv is now --prompt <prompt> [--model <id>].
  • Removed the Kimi K2.6 thinking-level picker, since there's no CLI flag for it to set. resolveThinkingLevel already returns undefined for models without levels, so a saved on/off choice is ignored rather than rejected.
  • Replaced the old Kimi assertions with one exact-argv regression test.

This adopts #14790 by @bbingz. Their commit is cherry-picked unchanged onto current main with authorship kept. On top of it, I narrowed the tests to one exact-argv check and corrected the comment: it now says Kimi Code has never had these flags, instead of saying "0.36–0.40 reject" them. Supersedes #14790.

Verification

  • Repro on main with the real CLI. @moonshot-ai/[email protected] installed into an isolated npm prefix and HOME. Running kimi --prompt "say hi" --quiet prints error: unknown option '--quiet' and exits 1. --thinking and --no-thinking print the same error, and --print gives unknown option '--print' (Did you mean --prompt?).
  • End to end with this branch. I built argv with Orca's COMMIT_MESSAGE_AGENT_SPECS.kimi.buildArgs (thinkingLevel on) and ran the real Kimi Code 2.3.1 against an env-configured model (KIMI_MODEL_*).
    • Exit 0.
    • stdout "• login-page\n\n"; the model's thinking went to stderr.
    • cleanGeneratedCommitMessage gave "login-page".
  • Regression test. It fails on main's spec and passes here: pnpm test src/shared/commit-message-agent-spec.test.ts src/shared/commit-message-plan.test.ts src/shared/commit-message-generation.test.ts passes 100/100.
  • pnpm tc:node and pnpm run check:code-quality:changed both pass.

Risk

  • Legacy Python kimi-cli ≤1.50 users who never migrated. Without --quiet, --prompt would open the legacy interactive shell instead of running headless. Upstream archived that CLI and says existing installs "will stop working", and the current kimi-cli release is a deprecation stub anyway. We don't add version gating for a dead CLI.
  • Mixed versions over a remote runtime. An older client that sends thinkingLevel: on for Kimi K2.6 to a newer server now gets "does not support a thinking effort level". Before this change that pairing failed anyway (Kimi rejected --thinking), and the Config default model, which has no thinking levels, is unaffected.
  • Known gap, not addressed here. Kimi Code's text renderer indents assistant continuation lines by 2 spaces (apps/kimi-code/src/cli/prompt-render.ts:269-310). Multi-line commit bodies therefore keep that indent on lines after the first. Branch names and subjects are clean.

Platform/mobile: shared argv only. It is the same on macOS, Linux and Windows, local and SSH, and for folder workspaces. Nothing changes on mobile.

Fixes #14771

Co-authored-by: BingZ [email protected]

bbingz and others added 2 commits October 24, 2026 15:17
kimi-code 0.36–0.40 reject --quiet, --thinking, and --no-thinking as
unknown options, so Source Control AI fails before the prompt is read.
Keep --prompt and optional --model, and stop advertising thinking levels
that regenerate those flags.
Collapse the Kimi flag assertions into one exact-argv regression and cite
Kimi Code (not legacy kimi-cli) as the reason the flags are gone.

Co-authored-by: BingZ <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 4 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9d38fc14-c14a-4c7e-856d-8d4d348fede3
Commits

Reviewing files that changed from the base of the PR and between c1a33b7 and 6a5976e.

Files selected for processing: 2
  • src/shared/commit-message-agent-spec.test.ts
  • src/shared/commit-message-agent-specs-secondary.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Source Control AI: Kimi recipe fails — baked-in --quiet flag unknown to kimi-code 0.36.x

2 participants