Skip to content

Commit 58d3ba9

Browse files
committed
Overlay branch overlay/web-work-log on top of origin/main via Merge
• a94d2b124b Overlay branch overlay/web-work-log on top of origin/main via Merge |\ | • 2d75bf6 Overlay branch overlay/web-work-log on top of origin/main via Merge | |\ | | • 834a12c fix(web): long tool arguments get a height-capped block in the inspector | | • 043df2b fix(web): approvals with multi-line prompts use their title as the row label • | | 807319c fix(opencode): retry failed model catalogs until they recover (pingdotgg#23939) • | | 49597c7 test(forgejo): answer the base branch read in the skipped-checks test (pingdotgg#23952) • | | 656f3f4 fix(cursor): fail turns that end in a transport error after commentary (pingdotgg#23273) • | | 6d9ec7b fix(pi): stop blank input placeholders from failing the run (pingdotgg#23235)
2 parents 807319c + 2d75bf6 commit 58d3ba9

3 files changed

Lines changed: 44 additions & 0 deletions

File tree

‎apps/web/src/components/chat/MessagesTimeline.logic.test.ts‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,38 @@ describe("deriveMessagesTimelineRows", () => {
277277
});
278278
});
279279

280+
it("labels an approval with a multi-line prompt by its title", () => {
281+
const fixture = makeStreamingTimelineFixture();
282+
const source = fixture.visibleTurnItems[0]!;
283+
const label = (title: string | null, prompt: string) => {
284+
const item: OrchestrationV2ProjectedTurnItem["item"] = {
285+
...source.item,
286+
id: TurnItemId.make("approval"),
287+
nodeId: null,
288+
providerThreadId: null,
289+
providerTurnId: null,
290+
nativeItemRef: null,
291+
parentItemId: null,
292+
status: "waiting",
293+
title,
294+
type: "approval_request",
295+
requestId: RuntimeRequestId.make("approval-request"),
296+
requestKind: "permission",
297+
prompt,
298+
};
299+
const [entry] = deriveTimelineEntriesFromVisibleTurnItems({
300+
visibleTurnItems: [{ ...source, item, sourceItemId: item.id }],
301+
optimisticMessages: [],
302+
});
303+
if (entry?.kind !== "work") throw new Error("Expected an approval work entry");
304+
return workEntryDisplayLabel(entry.entry, undefined);
305+
};
306+
const cell = 'import os\nprint(os.listdir("build"))';
307+
expect(label("Allow ipython?", cell)).toBe("Allow ipython?");
308+
expect(label("Allow bash?", "rm -rf build")).toBe("rm -rf build");
309+
expect(label(null, cell)).toBe(cell);
310+
});
311+
280312
it.each(["waiting", "completed"] as const)(
281313
"groups approval and user-input requests with commands without expanding them when %s",
282314
(status) => {

‎apps/web/src/components/chat/MessagesTimeline.logic.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ export function workEntryDisplayLabel(entry: WorkLogEntry, workspaceRoot: string
154154
item?.type === "dynamic_tool" ? dynamicToolTitle(item.toolName, item.input, item.title) : null;
155155
if (title) return title;
156156
const compactDetail = entry.detail?.trim();
157+
// A multi-line prompt is a code cell or script that collapses into one unreadable row label;
158+
// the full prompt stays in the inspector.
159+
const approvalTitle = item?.type === "approval_request" ? item.title?.trim() : undefined;
160+
if (approvalTitle && /[\r\n]/.test(compactDetail ?? "")) return approvalTitle;
157161
const detailIsSearchOutput =
158162
(action === "code-search" || action === "search") && /[\r\n]/.test(compactDetail ?? "");
159163
if (compactDetail && !providerRetry && action !== "read" && !detailIsSearchOutput) {

‎apps/web/src/components/chat/V2ItemInspector.tsx‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,12 @@ export function FetchedToolOutput(props: {
197197
);
198198
}
199199

200+
// Scripts, file contents, and other large arguments get a height-capped block of their own
201+
// instead of growing the inspector without bound after their key.
202+
function isBlockToolArg(value: string): boolean {
203+
return value.length > 300 || value.includes("\n");
204+
}
205+
200206
function ToolCallBody(
201207
props: ToolOutputState & {
202208
readonly command?: string;
@@ -218,6 +224,8 @@ function ToolCallBody(
218224
<span className="text-muted-foreground">{key} </span>
219225
{key === "code" && isJavaScriptReplTool(props.toolName) ? (
220226
<StructuredValue value={value} language="typescript" />
227+
) : isBlockToolArg(value) ? (
228+
<StructuredValue value={value} />
221229
) : (
222230
value
223231
)}

0 commit comments

Comments
 (0)