Skip to content

Commit 835e726

Browse files
juansuaya17claudejuliusmarminge
authored
fix(server): Claude subagents no longer show the parent's effort (pingdotgg#17042)
Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Julius Marminge <[email protected]>
1 parent 2718827 commit 835e726

3 files changed

Lines changed: 8 additions & 14 deletions

File tree

‎apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15819,11 +15819,11 @@ describe("ClaudeAdapterV2 background wake turns", () => {
1581915819
),
1582015820
);
1582115821

15822-
it.effect("gives a nested subagent its own effort, else the one its owner runs at", () =>
15822+
it.effect("records only explicit effort for nested subagents", () =>
1582315823
Effect.scoped(
1582415824
Effect.gen(function* () {
1582515825
const OUTER_TOOL_USE_ID = "toolu-effort-outer";
15826-
const INHERITING_TOOL_USE_ID = "toolu-effort-nested-inheriting";
15826+
const UNSPECIFIED_TOOL_USE_ID = "toolu-effort-nested-unspecified";
1582715827
const OVERRIDING_TOOL_USE_ID = "toolu-effort-nested-overriding";
1582815828
const harness = yield* makeWakeHarness;
1582915829
const now = yield* DateTime.now;
@@ -15889,14 +15889,14 @@ describe("ClaudeAdapterV2 background wake turns", () => {
1588915889
type: "message",
1589015890
role: "assistant",
1589115891
content: [
15892-
agentCall(INHERITING_TOOL_USE_ID),
15892+
agentCall(UNSPECIFIED_TOOL_USE_ID),
1589315893
agentCall(OVERRIDING_TOOL_USE_ID, "max"),
1589415894
],
1589515895
},
1589615896
uuid: "00000000-0000-4000-8000-000000000223",
1589715897
session_id: WAKE_NATIVE_SESSION,
1589815898
}),
15899-
taskStarted(INHERITING_TOOL_USE_ID, "00000000-0000-4000-8000-000000000224"),
15899+
taskStarted(UNSPECIFIED_TOOL_USE_ID, "00000000-0000-4000-8000-000000000224"),
1590015900
taskStarted(OVERRIDING_TOOL_USE_ID, "00000000-0000-4000-8000-000000000225"),
1590115901
makeResultFrame({
1590215902
uuid: "00000000-0000-4000-8000-000000000226",
@@ -15921,15 +15921,15 @@ describe("ClaudeAdapterV2 background wake turns", () => {
1592115921
);
1592215922
assert.deepEqual(Object.fromEntries(efforts), {
1592315923
[`task-${OUTER_TOOL_USE_ID}`]: "low",
15924-
[`task-${INHERITING_TOOL_USE_ID}`]: "low",
15924+
[`task-${UNSPECIFIED_TOOL_USE_ID}`]: undefined,
1592515925
[`task-${OVERRIDING_TOOL_USE_ID}`]: "max",
1592615926
});
1592715927
const childEfforts = harness.events.flatMap((event) =>
1592815928
event.type === "app_thread.created" && event.appThread.id !== harness.threadId
1592915929
? [getModelSelectionStringOptionValue(event.appThread.modelSelection, "effort")]
1593015930
: [],
1593115931
);
15932-
assert.deepEqual(childEfforts, ["low", "low", "max"]);
15932+
assert.deepEqual(childEfforts, ["low", undefined, "max"]);
1593315933
}).pipe(
1593415934
Effect.provide(
1593515935
Layer.mergeAll(

‎apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6886,13 +6886,8 @@ export const makeClaudeAdapterV2 = Effect.fn("makeClaudeAdapterV2")(function* (
68866886
workflow === undefined
68876887
? undefined
68886888
: withWorkflowMemberThreadIds(workflow, childThreadId);
6889-
const effort =
6890-
existingSubagent === undefined
6891-
? (input.effort ??
6892-
input.owner?.effort ??
6893-
compileClaudeModelSelection(input.context.input.modelSelection, modelCatalog)
6894-
.effort)
6895-
: existingSubagent.effort;
6889+
// Unstated effort stays unknown: a custom agent definition may override the owner's.
6890+
const effort = existingSubagent === undefined ? input.effort : existingSubagent.effort;
68966891
const model = input.model ?? priorTask?.model ?? null;
68976892
const task = {
68986893
...(priorTask ?? {

‎apps/server/src/orchestration-v2/testkit/OrchestratorReplayRecovery.integration.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,6 @@ describe("orchestrator replay recovery", () => {
463463
assert.deepEqual(child?.thread.modelSelection, {
464464
instanceId: CLAUDE_MODEL_SELECTION.instanceId,
465465
model: "claude-sonnet-5",
466-
options: [{ id: "effort", value: "high" }],
467466
});
468467

469468
const conversation = (child?.turnItems ?? [])

0 commit comments

Comments
 (0)