The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 07:15 UTC
fix(shared): html_render cards show for Antigravity's acp-mcp-call terminal fallback (#38898)
Julius Marminge committed
Nov 18, 2026 at 20:04 UTC
158394194c6ba4a3e2b0cd1c2bab28ceacdca7e1
2 files changed
+16
-1
packages/shared/src/htmlRender.test.ts
+8
@@ -169,6 +169,14 @@ describe("htmlRenderFromToolItem", () => {
169
["html_render", result],
170
// OpenCode 2 Code Mode reports a script's nested html_render call as one `execute` item.
171
["execute", JSON.stringify(result)],
172
+ // Antigravity runs the `acp-mcp-call` terminal fallback and wraps its stdout.
173
+ [
174
+ "t3-code.html_render",
175
+ {
176
+ output: `Created At: 2026-11-19T02:54:02Z\nCompleted At: 2026-11-19T02:54:02Z\nCommand exited with code 0.\n\nCommand output:\n${JSON.stringify({ content: [], structuredContent: result, isError: false })}\r\n`,
177
+ exit_code: 0,
178
+ },
179
+ ],
180
] as const) {
181
expect(htmlRenderFromToolItem({ toolName, output })).toEqual(reference);
182
}
packages/shared/src/toolOutput.ts
+8
-1
@@ -29,6 +29,8 @@ const MAX_CONTENT_BLOCKS = 32;
29
const MAX_ENVELOPE_DEPTH = 4;
30
const MAX_ENVELOPE_NODES = 128;
31
const encoder = new TextEncoder();
32
+// Antigravity's terminal tool prefixes an `acp-mcp-call` result's stdout with timestamps and exit status.
33
+const TERMINAL_OUTPUT_MARKER = "\nCommand output:\n";
34
35
interface ResultReadBudget {
36
remainingBytes: number;
@@ -105,7 +107,12 @@ function readResult(value: unknown, budget: ResultReadBudget, depth = 0): Result
107
value.is_error === true ||
108
value._tag === "OrchestratorMcpFailure" ||
109
value.error != null;
108
- const content = value.structuredContent ?? value.content;
110
+ const terminal = typeof value.output === "string" ? value.output : "";
111
+ const marker = terminal.indexOf(TERMINAL_OUTPUT_MARKER);
112
+ const content =
113
+ value.structuredContent ??
114
+ value.content ??
115
+ (marker === -1 ? undefined : terminal.slice(marker + TERMINAL_OUTPUT_MARKER.length));
116
if (content !== undefined) {
117
const nested = readResult(content, budget, depth + 1);
118
return { ...nested, failed: failed || nested.failed };