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

Kimi Code (the current `kimi`) rejects --quiet/--thinking/--no-thinking; send only --prompt [--model]. Fixes #14771. Supersedes #14790.

Co-authored-by: BingZ <11211020+bbingz@users.noreply.github.com>
This commit is contained in:
Neil
2026-10-24 15:44:18 -07:00
committed by GitHub
co-authored by BingZ
parent 08ec2b3aac
commit c344f3f0ab
2 changed files with 19 additions and 43 deletions
+15 -29
View File
@@ -53,25 +53,22 @@ describe('COMMIT_MESSAGE_AGENT_SPECS', () => {
expect(COMMIT_MESSAGE_AGENT_SPECS.pi?.defaultModelId).toBe('default')
})
it('uses --prompt (not Claude --print) for Kimi non-interactive generation', () => {
// Why: kimi-code 0.31+ rejects --print; non-interactive mode is --prompt/-p (#11669).
it('passes only flags Kimi Code accepts for non-interactive generation', () => {
// Why: Kimi Code rejects --print/--quiet/--thinking/--no-thinking as unknown options (#11669, #14771).
const spec = COMMIT_MESSAGE_AGENT_SPECS.kimi
expect(spec).toBeDefined()
expect(spec!.promptDelivery).toBe('argv')
const args = spec!.buildArgs({
prompt: 'Name a branch for adding login',
model: 'kimi-code/kimi-for-coding',
thinkingLevel: 'on'
})
expect(args).toContain('--prompt')
expect(args).not.toContain('--print')
// Why: with argv delivery the prompt is the value of --prompt.
const promptIndex = args.indexOf('--prompt')
expect(promptIndex).toBeGreaterThanOrEqual(0)
expect(args[promptIndex + 1]).toBe('Name a branch for adding login')
expect(args).toContain('--quiet')
expect(args).toContain('--thinking')
expect(args).toEqual(expect.arrayContaining(['--model', 'kimi-code/kimi-for-coding']))
expect(spec?.promptDelivery).toBe('argv')
expect(
spec?.buildArgs({
prompt: 'Name a branch for adding login',
model: 'kimi-code/kimi-for-coding',
thinkingLevel: 'on'
})
).toEqual([
'--prompt',
'Name a branch for adding login',
'--model',
'kimi-code/kimi-for-coding'
])
})
it('uses Muse exec for non-interactive Source Control AI generation', () => {
@@ -101,17 +98,6 @@ describe('COMMIT_MESSAGE_AGENT_SPECS', () => {
])
})
it('maps Kimi thinking off and omission to distinct argv', () => {
const spec = COMMIT_MESSAGE_AGENT_SPECS.kimi!
const offArgs = spec.buildArgs({ prompt: 'PROMPT', model: 'default', thinkingLevel: 'off' })
const defaultArgs = spec.buildArgs({ prompt: 'PROMPT', model: 'default' })
expect(offArgs).toContain('--no-thinking')
expect(offArgs).not.toContain('--thinking')
expect(defaultArgs).not.toContain('--thinking')
expect(defaultArgs).not.toContain('--no-thinking')
})
it('omits Kimi --model for the config default and an empty model', () => {
const spec = COMMIT_MESSAGE_AGENT_SPECS.kimi!
@@ -84,16 +84,11 @@ export function buildSecondaryCommitMessageAgentSpecs({
// Why: kimi-code accepts the generation prompt only via --prompt/-p (Claude's
// --print is rejected). Deliver on argv so --prompt receives the text (#11669).
promptDelivery: 'argv',
buildArgs: ({ prompt, model, thinkingLevel }) => [
// Why: Kimi Code has no --quiet/--thinking/--no-thinking; -p alone is headless (#14771).
buildArgs: ({ prompt, model }) => [
'--prompt',
prompt,
'--quiet',
...(model && model !== 'default' ? ['--model', model] : []),
...(thinkingLevel === 'on'
? ['--thinking']
: thinkingLevel === 'off'
? ['--no-thinking']
: [])
...(model && model !== 'default' ? ['--model', model] : [])
],
modelSource: 'static',
models: [
@@ -102,12 +97,7 @@ export function buildSecondaryCommitMessageAgentSpecs({
// Why: Kimi resolves its managed model by provider/model; bare model
// names are rejected by the CLI with "LLM not set".
id: 'kimi-code/kimi-for-coding',
label: 'Kimi K2.6',
thinkingLevels: [
{ id: 'on', label: 'On' },
{ id: 'off', label: 'Off' }
],
defaultThinkingLevel: 'on'
label: 'Kimi K2.6'
}
],
defaultModelId: 'default'