Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): stop native subagents after runtime loss #19544

Closedomar7550(GitHub profile, opens in a new tab)wants to merge 4 commits intomain fromrefs/pull/19544/headopened View on GitHub

Showing 7 changed files with 84 additions and 4 deletions (loading 4).

x
0 of 7 viewed, 7 left
58 additions and 0 deletionsapps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.tsModified
View file
@@ -9765,6 +9765,26 @@
+ it.effect("acknowledges an orphaned native Stop when no query owns the recorded thread", () =>
+ Effect.scoped(
+ Effect.gen(function* () {
+ const harness = yield* makeWakeHarness;
+ const outcome = yield* harness.runtime.stopSubagent!({
+ providerThread: harness.providerThread,
+ nativeTaskId: "historical-orphan",
+ });
+ assert.equal(outcome?.status, "interrupted");
+ assert.isNull(outcome?.result);
+ assert.deepEqual(outcome?.completedAt, yield* DateTime.now);
+ assert.lengthOf(harness.offeredMessages, 0);
+ }).pipe(
+ Effect.provide(
+ Layer.mergeAll(IdAllocator.layer, McpProviderSessions.layer, NodeServices.layer),
+ ),
+ ),
+ ),
+ );
+​
const makeStopFixture = (options?: Parameters<typeof makeWakeHarnessWithOptions>[0]) =>
Effect.gen(function* () {
const requests = yield* Queue.unbounded<void>();
@@ -9841,6 +9861,44 @@