Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix: html_render pages show inline when OpenCode or ACP agents wrap the call #17031

Closedehfreema(GitHub profile, opens in a new tab)wants to merge 25 commits intomain fromrefs/pull/17031/headopened View on GitHub

Showing 16 changed files with 29 additions and 2 deletions (loading 13).

x
0 of 16 viewed, 16 left
27 additions and 0 deletionsapps/mobile/src/lib/threadActivity.test.tsModified
View file
@@ -77,6 +77,33 @@
expect(presented[2]).toMatchObject({ activities: [{ projectedItem: { item } }] });
});
​
+it("shows a page an execute script returned only when it was published for the row's thread", () => {
+ const executeCall = (id: string, thread: string) =>
+ ({
+ ...base(id, "2026-06-20T00:00:02.000Z", 1),
+ type: "dynamic_tool",
+ toolName: "execute",
+ input: { code: "return await tools.render()" },
+ output: JSON.stringify({
+ htmlRender: {
+ attachmentId: `${thread}-00000000-0000-4000-8000-000000000001-html`,
+ title: "Chart",
+ height: 420,
+ },
+ }),
+ }) as OrchestrationV2TurnItem;
+ const pages = (row: OrchestrationV2ProjectedTurnItem) =>
+ buildThreadFeed([row]).filter((entry) => entry.type === "html-render");
+​
+ expect(pages(projected(executeCall("own", threadId), 0))).toHaveLength(1);
+ expect(pages(projected(executeCall("foreign", "thread-2"), 0))).toEqual([]);
+ // An inherited row is checked against the thread it came from, not the one showing it.
+ expect(pages(projected(executeCall("inherited", sourceThreadId), 0, "inherited"))).toHaveLength(
+ 1,
+ );
+ expect(pages(projected(executeCall("inherited-local", threadId), 0, "inherited"))).toEqual([]);
+});