Skip to content

Commit d21260b

Browse files
t3dotggclaude
andcommitted
fix(client): rerouted Lineage stop ignores a parent run id
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 3034dfb commit d21260b

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎packages/client-runtime/src/operations/commands.test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,8 @@ describe("V2 environment commands", () => {
631631
commandId: CommandId.make("lineage-stop"),
632632
threadId: v2ThreadId,
633633
subagentId,
634+
// A parent run must not be interrupted on the child thread.
635+
runId,
634636
}).pipe(Effect.provideService(EnvironmentSupervisor.EnvironmentSupervisor, supervisor));
635637
expect(commands).toEqual([
636638
{

‎packages/client-runtime/src/operations/commands.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,9 @@ export const interruptThreadTurn = Effect.fn("EnvironmentCommands.interruptThrea
797797
});
798798
}
799799
}
800-
let runId = input.runId ?? (input.turnId as RunId | undefined);
800+
// A run named by the caller belongs to the parent, not the rerouted child.
801+
let runId =
802+
threadId === input.threadId ? (input.runId ?? (input.turnId as RunId | undefined)) : undefined;
801803
if (runId === undefined) {
802804
const config = yield* getInitialServerConfig();
803805
if (config.environment.capabilities.threadStop === true) {

0 commit comments

Comments
 (0)