@devries-cameron20 / t3code-1 / commits / d47591f613
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(acp): OMP threads show html_render pages (#33677)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Nov 10, 2026 at 00:18 UTC d47591f613a28818d583bd3003f950ccd5060951
2 files changed +72
packages/provider-acp/src/server/runtimeModel.test.ts
+62
@@ -1380,6 +1380,68 @@ describe("extractMcpToolCallIdentity", () => {
1380 }
1381 });
1382
1383 + // regression: #33667 OMP mounts MCP tools as xd:// devices and calls them through `write`.
1384 + it("recovers T3 identity from OMP xd:// device writes but not its doc reads", () => {
1385 + const args = {
1386 + html: '<svg width="320" height="120"><rect width="300" height="100" fill="#4f46e5"/></svg>',
1387 + title: "Static SVG",
1388 + };
1389 + const result = {
1390 + htmlRender: { attachmentId: "synthetic-attachment-html", title: "Static SVG", height: 136 },
1391 + message: "Shown to the reader above your reply.",
1392 + };
1393 + const text = JSON.stringify(result);
1394 + const created = toolCallFromUpdate({
1395 + sessionUpdate: "tool_call",
1396 + toolCallId: "toolu_015ATZG99gw99Rrp4htieLux",
1397 + title: "Rendering static SVG",
1398 + kind: "execute",
1399 + status: "pending",
1400 + rawInput: { path: "xd://mcp__t3_code_html_render", content: JSON.stringify(args) },
1401 + });
1402 + const completed = mergeToolCallState(
1403 + created,
1404 + toolCallFromUpdate({
1405 + sessionUpdate: "tool_call_update",
1406 + toolCallId: "toolu_015ATZG99gw99Rrp4htieLux",
1407 + status: "completed",
1408 + rawOutput: {
1409 + content: [{ type: "text", text }],
1410 + details: {
1411 + xdev: {
1412 + tool: "mcp__t3_code_html_render",
1413 + mode: "execute",
1414 + args,
1415 + tier: "write",
1416 + inner: {
1417 + serverName: "t3-code",
1418 + mcpToolName: "html_render",
1419 + rawContent: [{ type: "text", text }],
1420 + provider: "acp",
1421 + providerName: "ACP Client",
1422 + structuredContent: result,
1423 + },
1424 + },
1425 + },
1426 + },
1427 + content: [{ type: "content", content: { type: "text", text } }],
1428 + }),
1429 + );
1430 + const docRead = toolCallFromUpdate({
1431 + sessionUpdate: "tool_call",
1432 + toolCallId: "toolu_read",
1433 + title: "Reading html_render schema",
1434 + kind: "read",
1435 + status: "pending",
1436 + rawInput: { path: "xd://mcp__t3_code_html_render" },
1437 + });
1438 +
1439 + const expected = { server: "t3-code", tool: "html_render", input: args };
1440 + expect(extractMcpToolCallIdentity(created), "pending write").toEqual(expected);
1441 + expect(extractMcpToolCallIdentity(completed), "completed write").toEqual(expected);
1442 + expect(extractMcpToolCallIdentity(docRead), "doc read").toBeUndefined();
1443 + });
1444 +
1445 it("does not claim an agent's own tool that shares a T3 tool name", () => {
1446 const toolCall = toolCallFromUpdate({
1447 sessionUpdate: "tool_call",
packages/provider-acp/src/server/runtimeModel.ts
+10
@@ -1142,6 +1142,16 @@ export function extractMcpToolCallIdentity(
1142 const tool = prefix === undefined ? metaToolName : metaToolName.slice(prefix.length);
1143 return tool ? { server: metaServerId, tool } : undefined;
1144 }
1145 + // OMP mounts MCP tools as xd://mcp__<server>_<tool> devices and calls them by writing JSON
1146 + // args; a read of the same path only fetches the tool's docs.
1147 + const devicePath = typeof rawInput?.path === "string" ? rawInput.path : "";
1148 + if (devicePath.startsWith("xd://") && typeof rawInput?.content === "string") {
1149 + const deviceTool = T3_MCP_TITLE_CALL.exec(devicePath.slice("xd://".length))?.groups?.tool;
1150 + if (deviceTool !== undefined && T3_MCP_TOOL_NAMES.has(deviceTool)) {
1151 + const input = acpMcpFallbackInput(rawInput.content);
1152 + return { server: "t3-code", tool: deviceTool, ...(input === undefined ? {} : { input }) };
1153 + }
1154 + }
1155 const candidates = [
1156 meta?.toolName,
1157 claudeCode?.toolName,