Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): Claude model changes no longer kill running background agents #14726

Mergedjuliusmarmingemerged 3 commits intomain fromrefs/pull/14726/headmerged by juliusmarminge View on GitHub

Showing 3 changed files with 184 additions and 13 deletions (loading 2).

x
0 of 3 viewed, 3 left
184 additions and 13 deletionsapps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.tsModified
View file
@@ -62,6 +62,7 @@
type ProviderAdapterV2TurnInput,
} from "../ProviderAdapter.ts";
import type { ProviderContinuationRequest } from "../ProviderContinuationRequests.ts";
+import { makeProviderFailure } from "../ProviderFailure.ts";
import * as ClaudeAdapterV2 from "./ClaudeAdapterV2.ts";
import * as IdAllocator from "../IdAllocator.ts";
​
@@ -6608,12 +6609,25 @@
assert.equal(processQueues.length, 1);
const firstProcess = processQueues[0]!;
yield* Queue.offer(firstProcess, wakeTaskStarted);
+ // The shell leaves the roster before its notification arrives, so
+ // nothing runs in this process any more and a model change may
+ // replace it. Wake eligibility outlives the empty level.
+ yield* Queue.offer(
+ firstProcess,
+ claudeSdkFrame({
+ type: "system",
+ subtype: "background_tasks_changed",
+ tasks: [],
+ uuid: "00000000-0000-4000-8000-000000000603",
+ session_id: WAKE_NATIVE_SESSION,
+ }),
+ );
yield* Queue.offer(firstProcess, turnOneResult);
yield* awaitUntil(
() => events.some((event) => event.type === "turn.terminal"),
"first turn terminal",