Skip to content

Commit 394b662

Browse files
only21milclaude
andcommitted
fix(claude): parent the resume-dialog request under the turn root
The resume dialog skips the tool row, so its user_input_request node pointed at a provider-item node nobody emitted. Give it the turn root. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent f2dee1e commit 394b662

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3484,6 +3484,14 @@ describe("ClaudeAdapterV2 background wake turns", () => {
34843484
),
34853485
).pipe(Effect.forkScoped);
34863486
const request = yield* Queue.take(harness.runtimeRequestReceipts);
3487+
assert.deepEqual(
3488+
harness.events.flatMap((event) =>
3489+
event.type === "node.updated" && event.node.id === request.runtimeRequest.nodeId
3490+
? [event.node.parentNodeId]
3491+
: [],
3492+
),
3493+
[NodeId.make("node-attempt-resume-dialog")],
3494+
);
34873495
yield* harness.runtime.respondToRuntimeRequest({
34883496
requestId: request.runtimeRequest.id,
34893497
answers: {

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6390,6 +6390,7 @@ export const makeClaudeAdapterV2 = Effect.fn("makeClaudeAdapterV2")(function* (
63906390
readonly context: ActiveClaudeTurnContext;
63916391
readonly nativeItemId: string;
63926392
readonly nativeRequestId: string;
6393+
readonly parentNodeId?: OrchestrationV2ExecutionNode["id"];
63936394
readonly requestKind: OrchestrationV2RuntimeRequest["kind"];
63946395
readonly prompt?: string;
63956396
readonly presentation?: ReturnType<typeof claudeApprovalPresentation>;
@@ -6422,10 +6423,12 @@ export const makeClaudeAdapterV2 = Effect.fn("makeClaudeAdapterV2")(function* (
64226423
id: nodeId,
64236424
threadId: input.context.input.threadId,
64246425
runId: input.context.input.runId,
6425-
parentNodeId: idAllocator.derive.nodeFromProviderItem({
6426-
driver: CLAUDE_PROVIDER,
6427-
nativeItemId: input.nativeItemId,
6428-
}),
6426+
parentNodeId:
6427+
input.parentNodeId ??
6428+
idAllocator.derive.nodeFromProviderItem({
6429+
driver: CLAUDE_PROVIDER,
6430+
nativeItemId: input.nativeItemId,
6431+
}),
64296432
rootNodeId: input.context.input.rootNodeId,
64306433
kind: input.questions === undefined ? "approval_request" : "user_input_request",
64316434
status: "waiting",
@@ -8855,6 +8858,10 @@ export const makeClaudeAdapterV2 = Effect.fn("makeClaudeAdapterV2")(function* (
88558858
context,
88568859
nativeItemId: nativeRequestId,
88578860
nativeRequestId,
8861+
// No tool node exists for a control request to hang under.
8862+
...(options?.startToolCall === false
8863+
? { parentNodeId: context.input.rootNodeId }
8864+
: {}),
88588865
requestKind: "user_input",
88598866
questions,
88608867
});

0 commit comments

Comments
 (0)