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];