Skip to content

fix(commit-message): use Kimi --prompt instead of Claude --print - #11674

Merged
AmethystLiang merged 2 commits into
stablyai:mainfrom
bbingz:fix/kimi-branch-rename-prompt-flag
Aug 8, 2026
Merged

AmethystLiang merged 2 commits into
stablyai:mainfrom
bbingz:fix/kimi-branch-rename-prompt-flag

Conversation

@bbingz

@bbingz bbingz commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #11669 (P0).

Branch auto-rename and Source Control commit-message generation are broken for every Kimi Code user: Orca invokes kimi with Claude's --print flag, kimi-code exits with unknown option '--print' and suggests --prompt, and generation fails.

Summary

The Kimi entry in COMMIT_MESSAGE_AGENT_SPECS now builds kimi --prompt <text> --quiet [--model …] [--thinking|--no-thinking].

Why promptDelivery flips from stdin to argv: kimi-code accepts the generation prompt only as the value of --prompt, so it has to be on argv. That is not a new code path — planCommitMessageGeneration already passes the prompt into spec.buildArgs for argv specs and leaves stdinPayload null (src/shared/commit-message-plan.ts:220 and :255), which is exactly how Copilot has been wired all along (commit-message-agent-spec.ts, promptDelivery: 'argv' with '--prompt', prompt). Only the Kimi spec changes; every other agent keeps stdin delivery.

Both broken surfaces run through that plan: branch auto-rename via first-work-branch-rename.ts → commit-message-text-generation.ts, and Source Control via source-control-generation-plan.ts.

Screenshots

No visual change.

Testing

  • pnpm exec vitest run --config config/vitest.config.ts src/shared/commit-message-agent-spec.test.ts src/shared/commit-message-plan.test.ts (52 tests)
  • Independent Grok review: APPROVED

New spec tests assert that --prompt is present and --print is absent, that the prompt is the argv value immediately after --prompt, that --thinking / --no-thinking / omission map to distinct argv, and that --model is omitted for both the config default and an empty model.

Notes

Shared spec change only — no platform-specific behaviour; the flags are the same on macOS, Linux and Windows.

@greptile-apps

greptile-apps Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

Greptile Summary

Fixes Kimi commit-message generation by replacing the now-rejected --print flag with --prompt <text>, and switching promptDelivery from 'stdin' to 'argv' so commit-message-plan.ts routes the prompt text through buildArgs instead of stdin.

  • commit-message-agent-spec.ts: kimi spec gains promptDelivery: 'argv', buildArgs now accepts and emits prompt as --prompt <text>, with --quiet following and the existing thinking-level ternary and model guard unchanged.
  • commit-message-agent-spec.test.ts: Three new focused tests cover the --prompt/no---print happy path, both non-'on' thinking-level branches, and the 'default'/empty model guard — filling the coverage gaps from the prior review.

Confidence Score: 5/5

Safe to merge — the change is a minimal, targeted fix to a broken CLI flag with no side effects on other agents.

The only touched code is the Kimi spec: --print (rejected by kimi-code 0.31+) is replaced with --prompt <text> and promptDelivery is updated to 'argv'. The downstream consumer (commit-message-plan.ts) already handles 'argv' delivery correctly, passing the prompt through buildArgs and setting stdinPayload to null. All three thinking-level branches and the model-default guard are covered by the new tests, and no other agent specs are affected.

Files Needing Attention: No files require special attention.

Important Files Changed

Filename Overview
src/shared/commit-message-agent-spec.ts Switches Kimi from promptDelivery: 'stdin' with --print to promptDelivery: 'argv' with --prompt <text> --quiet, matching kimi-code 0.31+ CLI requirements; the three-way thinking-level ternary and model guard are unchanged and correct.
src/shared/commit-message-agent-spec.test.ts Adds three new Kimi tests: --prompt vs --print with thinkingLevel='on', thinkingLevel='off' vs undefined to cover both remaining ternary branches, and model='default'/model='' to verify --model omission — addressing all gaps flagged in prior review threads.

Reviews (2): Last reviewed commit: "test(commit-message): cover Kimi argumen..." | Re-trigger Greptile

@coderabbitai

coderabbitai Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Kimi commit-message generation now passes the prompt through the --prompt argument instead of stdin. The argument builder retains quiet, thinking-level, and model options. Regression tests verify prompt placement, --no-thinking, omission of --model for default or empty models, and exclusion of --print.

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The changes update commit-message invocation, but the linked issue requires fixing branch auto-renaming invocation for Kimi. Update the branch auto-renaming Kimi argv construction to use --prompt, then add regression coverage for that path.
Out of Scope Changes check ⚠️ Warning The reviewed changes target commit-message generation while the linked issue targets branch auto-renaming, so the primary issue scope is not implemented. Limit the changes to branch auto-renaming requirements or link the commit-message work to an issue that covers that behavior.
Description check ⚠️ Warning The description explains the fix and targeted tests, but it omits the required AI Review Report and Security Audit and does not document standard checks. Add the AI Review Report and Security Audit sections, confirm macOS/Linux/Windows review coverage, and record lint, typecheck, test, and build results or explain omissions.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly describes the main change: replacing Kimi's unsupported Claude --print flag with --prompt.

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.

bbingz added 2 commits August 6, 2026 07:43
kimi-code rejects --print (suggesting --prompt). Deliver the generation
prompt as the --prompt argv value so branch auto-rename and commit
message generation work when Kimi is the selected agent.

Fixes stablyai#11669
@bbingz
bbingz force-pushed the fix/kimi-branch-rename-prompt-flag branch from 607a83b to 33e82ac Compare August 5, 2026 23:43
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@AmethystLiang
AmethystLiang requested review from AmethystLiang and removed request for brennanb2025 August 8, 2026 02:30
@AmethystLiang
AmethystLiang merged commit 523feda into stablyai:main Aug 8, 2026
@bbingz

bbingz commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @AmethystLiang for the merge — and for closing #11669 with it.

@Alexander951006

Copy link
Copy Markdown

Heads-up: this fix unfortunately still doesn't work in v1.4.179 — the new invocation adds --quiet, which kimi-code does not support either.

Error (from the worktree's firstAgentMessageRenameError, Orca 1.4.179):

Kimi CLI command failed with code 1: error: unknown option '--quiet'

Verified locally against the latest published CLI versions:

$ kimi --version
0.34.0
$ kimi --quiet
error: unknown option '--quiet'

$ pi --quiet
Error: Unknown option: --quiet        # pi 0.83.0

$ omp --quiet
Error: unknown flag: --quiet          # @oh-my-pi/pi-coding-agent 17.2.12

So --quiet is rejected by all three of kimi-code, pi, and omp. For kimi-code, plain kimi --prompt "<text>" (no extra flags) works — that's what I verified end-to-end when reporting #11669.

One compounding issue: my worktrees running pi/omp agents also show this failure as a Kimi CLI error — the rename still runs through the configured default agent (kimi) instead of the workspace's agent, i.e. #11009 is still reproducible on 1.4.179 and #11147 is still needed.

Happy to test the next RC again.

@bbingz

bbingz commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the residual report — confirmed on current main.

COMMIT_MESSAGE_AGENT_SPECS.kimi.buildArgs still emits --quiet after --prompt (src/shared/commit-message-agent-spec.ts), so kimi-code 0.34 rejecting --quiet matches the 1.4.179 failure. #11674 only swapped Claude's --print for --prompt; it did not remove unsupported quiet flags.

Follow-up should drop --quiet for kimi (and avoid adding it for pi/omp if those paths share the same builder). The workspace-agent vs default-agent rename path you mention is separate (#11009 / #11147), not this PR.

Appreciate the CLI repro matrix — happy to re-check once a drop-quiet fix lands.

enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…blyai#11674)

* fix(commit-message): use Kimi --prompt instead of Claude --print

kimi-code rejects --print (suggesting --prompt). Deliver the generation
prompt as the --prompt argv value so branch auto-rename and commit
message generation work when Kimi is the selected agent.

Fixes stablyai#11669

* test(commit-message): cover Kimi argument defaults
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.

[Bug]: Branch auto-name fails with Kimi Code — invoked with unsupported '--print' flag (kimi-code uses '-p/--prompt')

4 participants