fix(kimi-k3): recover abandoned tool calls (DIS-3537) #647
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.48) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 558 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.378
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #647"
general
weight: 0.35
luckyq
Overview
The Kimi K3 v1 jail suppresses markup from an abandoned call. The v2 Unified parser keeps a valid retry separate from the abandoned call and preserves early argument streaming on well-formed calls.
Details
0.10.10.Bug Fix Evidence
1. Minimal Sample Input
Native Kimi K3 with a
bashtool that takes one string argument namedcommand. The first argument remains open when the second tools section starts. The tests replay whole input and every split. V2 also exercises one Unicode scalar per push.2. Buggy Output (Before)
V1
11.0.13leaked the abandoned call into assistant text at a split after the response. V20.10.9kept visible text and completed onebashcall whose command contained both attempts and the intervening XTML.3. Expected/Fixed Output (After)
The v1 variant without a retry returns the visible text and zero calls. In v2, a partial chunk emitted before the restart can still reach the client. The parser never completes that abandoned index.
4. Unified Regression Cases
UNIFIED.kimi-abandoned_argument_then_retrystarts in Reasoning and replays the retry group in 64-character chunks before finish. GOLDEN has reasoning, visible text, and one completedbashcall withecho retry. This case applies to Kimi K3 because it uses the XTML response, tools, call, and typed-argument sequence. Shared marker cases cover the other families in their native syntax.5. Visual Conformance Verification
Regenerated
conformance/CONFORMANCE_v2.htmlwith the native publisher bound to the final candidate tree. Chrome 158 showed the clean retry and the preserved earlierkimi-typed_response_then_callcase in the Dynamo v20.10.10popups. Kimi K3 qualification reported zero red and zero empty cells.Verification
110 focused v1 tests and 92 focused v2 tests passed. The fresh capture replay covered 5,044 cases with zero Dynamo disagreements. The strict current-capture replay passed on all 4,829 native observations. The capture refresh preserves 4,828 prior observations and adds one case.
Validation
cargo test --locked -p dynamo-parsers --lib --test jail kimi_k3,cargo test --locked -p dynamo-parsers-v2 --lib kimi_k3, and the strict replaycommitted_dynamo_capture_matches_the_live_parsersinunified_render. The independent parser audit replayed the completed-call checkpoint, literal XTML with a following call, invalid restart prefix, whitespace, multiple retries, and the response transition.Review scope and follow-up
I’ll only address P0 and P1 findings in this PR. P2 through P4 belong in a separate scope.
Tracking DIS-3537 and DIS-3536. Validation exercised the parser and native conformance paths. Dynamo HTTP replay remains open.
Where should the reviewer start?
parsers/v1/src/tool_calling/xtml/kimi_k3_parser.rs,parsers/v2/src/unified/kimi_k3.rsInternal use only: DIS-3537