@@ -18160,7 +18160,26 @@ describe("ClaudeAdapterV2 background wake turns", () => {
1816018160 ),
1816118161 );
1816218162
18163- it.effect("extracts text from direct content-block subagent results", () =>
18163+ it.effect.each([
18164+ {
18165+ label: "extracts text from direct content-block subagent results",
18166+ content: [
18167+ { type: "text", text: "First line." },
18168+ { type: "text", text: "Second line." },
18169+ ],
18170+ expected: "First line.\nSecond line.",
18171+ },
18172+ {
18173+ label: "drops Claude Code's tools-used note from a subagent result",
18174+ content: [
18175+ {
18176+ type: "text",
18177+ text: "<tools-used-before-summary>Read</tools-used-before-summary>\n\nadd (line 1)\nmean (line 6)",
18178+ },
18179+ ],
18180+ expected: "add (line 1)\nmean (line 6)",
18181+ },
18182+ ])("$label", ({ content, expected }) =>
1816418183 Effect.scoped(
1816518184 Effect.gen(function* () {
1816618185 const SUBAGENT_TASK_ID = "task-direct-content-blocks";
@@ -18214,10 +18233,7 @@ describe("ClaudeAdapterV2 background wake turns", () => {
1821418233 {
1821518234 type: "tool_result",
1821618235 tool_use_id: SUBAGENT_TOOL_USE_ID,
18217- content: [
18218- { type: "text", text: "First line." },
18219- { type: "text", text: "Second line." },
18220- ],
18236+ content,
1822118237 },
1822218238 ],
1822318239 },
@@ -18228,7 +18244,7 @@ describe("ClaudeAdapterV2 background wake turns", () => {
1822818244 );
1822918245 yield* harness.until(() => subagentEvents().at(-1)?.subagent.status === "completed");
1823018246
18231- assert.equal(subagentEvents().at(-1)?.subagent.result, "First line.\nSecond line." );
18247+ assert.equal(subagentEvents().at(-1)?.subagent.result, expected );
1823218248
1823318249 yield* Queue.offer(
1823418250 harness.sdkMessages,
0 commit comments