Repository navigation
fix(source-control): decode Kimi generated text by selected format - #34237
Conversation
Kimi Code's text mode prefixes thinking and hook output with a bullet, so the commit message arrived mixed with narration. The recipe now asks for --output-format stream-json and the answer is taken from the last assistant record, which is the commit message (#33556). A record that requests a tool is narration rather than an answer, so it clears the candidate: a stream that ends on a tool call yields no answer, which finalizeFromAgentOutput already treats as a failed run. Only a body whose every non-empty line is a record counts as stream output, so a plain answer that happens to contain a JSON line is left alone.
|
Warning Review limit reachedYou'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 24 seconds. View limit details
No actionable comments were generated in the recent review.
|
There was a problem hiding this comment.
Actionable comments posted: 7

Review info
-
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:
b34288ae-c18c-4db0-8762-6379b1248953
Files selected for processing: 11-
src/main/text-generation/commit-message-text-generation-generated-output.test.tssrc/main/text-generation/conversation-name-generation-request.test.tssrc/main/text-generation/jira-issue-summary-text-generation.test.tssrc/main/text-generation/source-control-agent-failure.tssrc/shared/__fixtures__/kimi-generation-source-shaped.tssrc/shared/command-option-occurrence.tssrc/shared/commit-message-agent-spec.test.tssrc/shared/commit-message-agent-specs-secondary.tssrc/shared/commit-message-plan.test.tssrc/shared/commit-message-plan.tssrc/shared/kimi-generation-output.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
-
|
Kimi-generated commit messages could contain presentation bullets, hook output, or pre-answer narration because the generation command requested text and shared cleanup could not distinguish an answer from protocol data. This change requests official Kimi Code stream-json and decodes it only when the effective execution plan selects that protocol. Commit messages, branch names, PR fields, conversation titles, and Jira summaries receive the decoded answer. Custom commands, explicit text overrides, and literal JSON from other providers keep their existing behavior. The full review loop completed three rounds, including architecture, every-consumer, performance, fresh final reference, and readiness checks. It corrected unsafe shared autodetection, malformed-success fallback, occupied-session failure handling, argument-copy amplification, and parser-error matching. Kimi failures now give authored causes/remedies while preserving raw diagnostics for the existing diagnostic view. No open review finding remains. An existing other-provider raw-error-copy inconsistency is outside this change; speculative successful hook-only wrappers remain an unproven limitation, with no added output heuristic. Validation:
For Brennan’s review: this CLI/tests flow requires no screenshot. The three judgment points are effective format selection, strict selected success decoding, and status-first finalization. |
The problem
With Kimi picked as the Source Control AI agent, Generate commit message filled the box with more than the message: Kimi's bullet (
•), plus anything Kimi printed before answering, such as a thinking line ("Simple request.") or the output of the user's Kimi hooks. In Kimi's plain-text output every line gets the same bullet, so Orca couldn't tell the answer from the rest.What this PR changes
How it works: Orca now asks Kimi for its machine-readable output (
--output-format stream-json), where each line is a labelled message, and keeps the assistant's last answer. It reads output this way only when that format is in effect, so a user who sets--output-format textin their CLI arguments keeps the old behavior.What stays the same
How it was tested
Tracked in STA-12141 and #33556.
Supersedes #33557 (kept @beduldul's commits).