@@ -9,7 +9,7 @@ import { Agent } from "@/agent/agent"
99import { Tool } from "@/tool/tool"
1010import { Truncate } from "@/tool/truncate"
1111import { outputLimits } from "./output-settings"
12- import { MAX_BASIS_CHARACTERS , renderAnswer } from "../tools/answer-commit"
12+ import { MAX_BASIS_CHARACTERS , normalizeAnswerArgs , renderAnswer } from "../tools/answer-commit"
1313import { AnswerCommitConjunction } from "../tools/answer-commit-conjunction"
1414import { MAX_SCANNED_CHARACTERS } from "../tools/answer-commit-checks"
1515import * as Precedence from "../workspace/precedence"
@@ -230,7 +230,10 @@ type TurnMessage = Tool.Context["messages"][number]
230230 * explanation never becomes part of the answer text a client copies. The basis is kept,
231231 * above that line, as context for the user.
232232 */
233- export function finalAnswerText ( args : Record < string , unknown > , committed : string , request ?: unknown ) : string {
233+ export function finalAnswerText ( raw : Record < string , unknown > , committed : string , request ?: unknown ) : string {
234+ // altimate_change start — #1700: read the same decoded shape the tool validated (JSON-string fields/rows)
235+ const args = normalizeAnswerArgs ( raw ) as Record < string , unknown >
236+ // altimate_change end
234237 // Answer-only only for a complete commit: rows, or fields covering every item the request names.
235238 // Otherwise keep the committed text (basis on the line) so an item kept only in the basis is not lost.
236239 const fields = Array . isArray ( args . fields ) ? args . fields . length : 0
0 commit comments