@@ -13067,6 +13067,105 @@ describe("ClaudeAdapterV2 background wake turns", () => {
1306713067 ),
1306813068 );
1306913069
13070+ it.effect("does not give a subagent under a fork skill the root effort", () =>
13071+ Effect.scoped(
13072+ Effect.gen(function* () {
13073+ const SKILL_TOOL_USE_ID = "toolu-effort-fork-skill";
13074+ const NESTED_TOOL_USE_ID = "toolu-effort-fork-nested";
13075+ const harness = yield* makeWakeHarness;
13076+ yield* harness.runtime.startTurn(
13077+ makeClaudeTestTurnInput({
13078+ threadId: harness.threadId,
13079+ providerThread: harness.providerThread,
13080+ now: yield* DateTime.now,
13081+ attemptId: RunAttemptId.make("attempt-subagent-fork-nested-effort"),
13082+ text: "Run the fork skill.",
13083+ attachments: [],
13084+ modelSelection: {
13085+ instanceId: CLAUDE_TEST_MODEL_SELECTION.instanceId,
13086+ model: "claude-opus-4-6",
13087+ options: [{ id: "effort", value: "high" }],
13088+ },
13089+ }),
13090+ );
13091+ const launch = (parentToolUseId: string | null, toolUse: object, uuid: string) =>
13092+ claudeSdkFrame({
13093+ type: "assistant",
13094+ parent_tool_use_id: parentToolUseId,
13095+ message: {
13096+ model: "claude-opus-4-6",
13097+ id: `msg_${uuid}`,
13098+ type: "message",
13099+ role: "assistant",
13100+ content: [toolUse],
13101+ },
13102+ uuid,
13103+ session_id: WAKE_NATIVE_SESSION,
13104+ });
13105+ const taskStarted = (id: string, uuid: string) =>
13106+ claudeSdkFrame({
13107+ type: "system",
13108+ subtype: "task_started",
13109+ task_id: `task-${id}`,
13110+ tool_use_id: id,
13111+ description: id,
13112+ task_type: "local_agent",
13113+ uuid,
13114+ session_id: WAKE_NATIVE_SESSION,
13115+ });
13116+ for (const frame of [
13117+ launch(
13118+ null,
13119+ {
13120+ type: "tool_use",
13121+ id: SKILL_TOOL_USE_ID,
13122+ name: "Skill",
13123+ input: { skill: "fork-probe" },
13124+ },
13125+ "00000000-0000-4000-8000-000000000231",
13126+ ),
13127+ taskStarted(SKILL_TOOL_USE_ID, "00000000-0000-4000-8000-000000000232"),
13128+ launch(
13129+ SKILL_TOOL_USE_ID,
13130+ {
13131+ type: "tool_use",
13132+ id: NESTED_TOOL_USE_ID,
13133+ name: "Agent",
13134+ input: { description: "nested", subagent_type: "general-purpose", prompt: "Check." },
13135+ },
13136+ "00000000-0000-4000-8000-000000000233",
13137+ ),
13138+ taskStarted(NESTED_TOOL_USE_ID, "00000000-0000-4000-8000-000000000234"),
13139+ makeResultFrame({ uuid: "00000000-0000-4000-8000-000000000235", result: "Done." }),
13140+ ]) {
13141+ yield* Queue.offer(harness.sdkMessages, frame);
13142+ }
13143+ yield* Queue.take(harness.terminalReceipts);
13144+
13145+ const efforts = new Map(
13146+ harness.events.flatMap((event) =>
13147+ event.type === "subagent.updated"
13148+ ? [
13149+ [
13150+ event.subagent.nativeTaskRef?.nativeId,
13151+ getModelSelectionStringOptionValue(event.subagent.modelSelection, "effort"),
13152+ ] as const,
13153+ ]
13154+ : [],
13155+ ),
13156+ );
13157+ assert.deepEqual(Object.fromEntries(efforts), {
13158+ [`task-${SKILL_TOOL_USE_ID}`]: undefined,
13159+ [`task-${NESTED_TOOL_USE_ID}`]: undefined,
13160+ });
13161+ }).pipe(
13162+ Effect.provide(
13163+ Layer.mergeAll(IdAllocator.layer, McpProviderSessions.layer, NodeServices.layer),
13164+ ),
13165+ ),
13166+ ),
13167+ );
13168+
1307013169 const FORK_SKILL_PARENT_SELECTION = {
1307113170 instanceId: CLAUDE_TEST_MODEL_SELECTION.instanceId,
1307213171 model: "claude-sonnet-4-6",
0 commit comments