From a4f4b3766fd6cda636da584ec82348fdfd1b3cbc Mon Sep 17 00:00:00 2001 From: can1357 Date: Tue, 28 Jul 2026 10:40:49 +0200 Subject: [PATCH] fix(coding-agent): budget Ask markdown against padded block width The symmetric-padding change shrank the framed-block content width to outputBlockContentWidth(width); the Ask renderer still pre-rendered its question/result Markdown at the old width-2 budget, so maximal-width rows re-wrapped inside the block and spilled a trailing fragment row. --- packages/coding-agent/src/tools/ask.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/coding-agent/src/tools/ask.ts b/packages/coding-agent/src/tools/ask.ts index c8ec1a4df..3770930fc 100644 --- a/packages/coding-agent/src/tools/ask.ts +++ b/packages/coding-agent/src/tools/ask.ts @@ -36,7 +36,7 @@ import type { ExtensionUISelectItem } from "../extensibility/extensions"; import { getMarkdownTheme, type Theme, theme } from "../modes/theme/theme"; import askDescription from "../prompts/tools/ask.md" with { type: "text" }; import { vocalizer } from "../tts/vocalizer"; -import { framedBlock, renderStatusLine } from "../tui"; +import { framedBlock, outputBlockContentWidth, renderStatusLine } from "../tui"; import type { ToolSession } from "."; import { formatErrorMessage, formatMeta, formatTitle } from "./render-utils"; import { ToolAbortError } from "./tool-errors"; @@ -1276,7 +1276,7 @@ export const askToolRenderer = { const mdTheme = getMarkdownTheme(); const accentStyle = { color: (t: string) => uiTheme.fg("accent", t) }; const md = (text: string, width: number) => - new Markdown(text, 1, 0, mdTheme, accentStyle).render(Math.max(1, width - 3 + 1)); + new Markdown(text, 1, 0, mdTheme, accentStyle).render(Math.max(1, outputBlockContentWidth(width) + 1)); // Multi-part questions: one divider-labelled section per question. // Call args are untrusted (partially streamed or model-mangled) and a @@ -1345,7 +1345,7 @@ export const askToolRenderer = { const mdTheme = getMarkdownTheme(); const accentStyle = { color: (t: string) => uiTheme.fg("accent", t) }; const md = (text: string, width: number) => - new Markdown(text, 1, 0, mdTheme, accentStyle).render(Math.max(1, width - 3 + 1)); + new Markdown(text, 1, 0, mdTheme, accentStyle).render(Math.max(1, outputBlockContentWidth(width) + 1)); if (!details) { const txt = result.content[0];