Skip to content

Commit 4dce9dc

Browse files
committed
fix(server): update native subagent tests for current adapter types
1 parent e5348d9 commit 4dce9dc

2 files changed

Lines changed: 11 additions & 15 deletions

File tree

‎apps/server/src/mcp/TaskCancelNativeSubagent.integration.test.ts‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ import * as Stream from "effect/Stream";
2424
import { ClaudeProviderCapabilitiesV2 } from "../orchestration-v2/Adapters/ClaudeAdapterV2.ts";
2525
import * as EffectWorker from "../orchestration-v2/EffectWorker.ts";
2626
import * as Orchestrator from "../orchestration-v2/Orchestrator.ts";
27-
import type {
28-
ProviderAdapterV2Event,
29-
ProviderAdapterV2Shape,
30-
ProviderAdapterV2TurnInput,
31-
} from "@t3tools/provider-core/server/ProviderAdapter";
27+
import * as ProviderAdapter from "@t3tools/provider-core/server/ProviderAdapter";
3228
import * as ProviderAdapterRegistry from "../orchestration-v2/ProviderAdapterRegistry.ts";
3329
import * as ThreadManagementService from "../orchestration-v2/ThreadManagementService.ts";
3430
import * as ProviderReplayHarness from "../orchestration-v2/testkit/ProviderReplayHarness.ts";
@@ -52,18 +48,18 @@ it.effect("task_cancel ends a delegated child's background native subagent", ()
5248
Effect.gen(function* () {
5349
const cwd = yield* checkpointWorkspace("task-cancel-native-subagent");
5450
const turns: Array<{
55-
readonly turn: ProviderAdapterV2TurnInput;
56-
readonly events: Queue.Queue<ProviderAdapterV2Event>;
51+
readonly turn: ProviderAdapter.ProviderAdapterV2TurnInput;
52+
readonly events: Queue.Queue<ProviderAdapter.ProviderAdapterV2Event>;
5753
}> = [];
58-
const adapter: ProviderAdapterV2Shape = {
54+
const adapter: ProviderAdapter.ProviderAdapterV2["Service"] = {
5955
instanceId,
6056
driver,
6157
getCapabilities: () => Effect.succeed(ClaudeProviderCapabilitiesV2),
6258
planSelectionTransition: () => Effect.succeed({ type: "apply_on_next_turn" }),
6359
openSession: (input) =>
6460
Effect.gen(function* () {
6561
const now = yield* DateTime.now;
66-
const events = yield* Queue.unbounded<ProviderAdapterV2Event>();
62+
const events = yield* Queue.unbounded<ProviderAdapter.ProviderAdapterV2Event>();
6763
return {
6864
instanceId,
6965
driver,
@@ -309,7 +305,7 @@ it.effect("task_cancel ends a delegated child's background native subagent", ()
309305
failure: null,
310306
threadDisposition: "reusable",
311307
},
312-
] satisfies ReadonlyArray<ProviderAdapterV2Event>) {
308+
] satisfies ReadonlyArray<ProviderAdapter.ProviderAdapterV2Event>) {
313309
yield* Queue.offer(child.events, event);
314310
}
315311
yield* Fiber.join(waiting);

‎apps/server/src/orchestration-v2/RunExecutionService.test.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,8 +1477,8 @@ it.effect("ends a nested native subagent and its thread when the root run is int
14771477
id,
14781478
lineage: { parentThreadId, relationshipToParent: "subagent", rootThreadId: threadId },
14791479
},
1480-
}) as ProviderAdapterV2Event;
1481-
const events: ReadonlyArray<ProviderAdapterV2Event> = [
1480+
}) as ProviderAdapter.ProviderAdapterV2Event;
1481+
const events: ReadonlyArray<ProviderAdapter.ProviderAdapterV2Event> = [
14821482
subagentThread(childThreadId, threadId),
14831483
subagentThread(grandchildThreadId, childThreadId),
14841484
{
@@ -1492,7 +1492,7 @@ it.effect("ends a nested native subagent and its thread when the root run is int
14921492
childThreadId: grandchildThreadId,
14931493
status: "running",
14941494
},
1495-
} as ProviderAdapterV2Event,
1495+
} as ProviderAdapter.ProviderAdapterV2Event,
14961496
{
14971497
type: "node.updated",
14981498
driver,
@@ -1503,7 +1503,7 @@ it.effect("ends a nested native subagent and its thread when the root run is int
15031503
kind: "root_turn",
15041504
status: "running",
15051505
},
1506-
} as ProviderAdapterV2Event,
1506+
} as ProviderAdapter.ProviderAdapterV2Event,
15071507
{
15081508
type: "turn.terminal",
15091509
driver,
@@ -1525,7 +1525,7 @@ it.effect("ends a nested native subagent and its thread when the root run is int
15251525
session: {
15261526
events: Stream.fromIterable(events),
15271527
startTurn: () => Effect.void,
1528-
} as unknown as ProviderAdapterV2SessionRuntime,
1528+
} as unknown as ProviderAdapter.ProviderAdapterV2SessionRuntime,
15291529
run: { id: runId, threadId, ordinal: 1, providerInstanceId } as OrchestrationV2Run,
15301530
rootNode: { id: NodeId.make(`node:${key}`) } as OrchestrationV2ExecutionNode,
15311531
checkpointScope: {

0 commit comments

Comments
 (0)