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.
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user