@@ -1081,11 +1081,33 @@ describe("AcpAdapterV2", () => {
10811081 title: "Check weather",
10821082 status: "completed",
10831083 rawInput: { server: "weather", tool: "get_weather", city: "Berlin" },
1084+ rawOutput: {
1085+ result: {
1086+ _meta: {
1087+ source: { name: "Weather", logoUrl: "https://example.com/weather.png" },
1088+ },
1089+ content: [{ type: "text", text: "Sunny" }],
1090+ },
1091+ },
10841092 _meta: {
10851093 is_mcp_tool_call: true,
10861094 "cognition.ai/subagent_context": { parentAgentId: "child-a" },
10871095 },
10881096 },
1097+ {
1098+ sessionUpdate: "tool_call",
1099+ toolCallId: "parent-weather",
1100+ title: "Check weather",
1101+ status: "completed",
1102+ rawInput: { server: "weather", tool: "get_weather", city: "Berlin" },
1103+ rawOutput: {
1104+ _meta: {
1105+ source: { name: "Weather", logoUrl: "https://example.com/weather.png" },
1106+ },
1107+ content: [{ type: "text", text: "Sunny" }],
1108+ },
1109+ _meta: { is_mcp_tool_call: true },
1110+ },
10891111 {
10901112 sessionUpdate: "agent_message_chunk",
10911113 content: { type: "text", text: " → decider → event)." },
@@ -1209,12 +1231,22 @@ describe("AcpAdapterV2", () => {
12091231 item.type === "dynamic_tool" &&
12101232 item.toolName === "weather.get_weather",
12111233 );
1212- assert.equal(childMcp?.title, "get weather");
1213- assert.deepEqual(childMcp?.toolSource, {
1214- key: "mcp:weather",
1215- name: "weather",
1216- kind: "integration",
1217- });
1234+ const parentMcp = items.find(
1235+ (item) =>
1236+ item.threadId === threadId &&
1237+ item.type === "dynamic_tool" &&
1238+ item.toolName === "weather.get_weather",
1239+ );
1240+ for (const item of [parentMcp, childMcp]) {
1241+ assert.equal(item?.title, "get weather");
1242+ assert.deepEqual(item?.toolSource, {
1243+ key: "mcp:weather",
1244+ name: "Weather",
1245+ kind: "integration",
1246+ icon: { _tag: "themed-logo", logoUrl: "https://example.com/weather.png" },
1247+ });
1248+ assert.deepEqual(item?.toolIcon, item?.toolSource?.icon);
1249+ }
12181250 assert.isTrue(
12191251 items.some(
12201252 (item) =>
@@ -1239,7 +1271,7 @@ describe("AcpAdapterV2", () => {
12391271 const parentTools = items.filter(
12401272 (item) => item.threadId === threadId && item.type === "dynamic_tool",
12411273 );
1242- assert.equal(parentTools.length, 1 );
1274+ assert.equal(parentTools.length, 2 );
12431275 assert.equal(parentTools[0]?.title, "Parent tool finished");
12441276 }).pipe(Effect.provide(testLayer), Effect.scoped),
12451277 );
0 commit comments