Skip to content

Commit b0152bc

Browse files
refactor(mcp): reuse model-selection command choice
1 parent 0ebe252 commit b0152bc

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎apps/server/src/mcp/toolkits/thread/handlers.ts‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
type OrchestrationV2Command,
99
} from "@t3tools/contracts";
1010
import * as Effect from "effect/Effect";
11+
import { modelSelectionCommandType } from "@t3tools/shared/model";
1112

1213
import { newCommandId, readThread, readWritableThread, unavailable } from "../../threadAccess.ts";
1314
import { queuedRunsInDeliveryOrder } from "../../../orchestration-v2/QueuedRunOrder.ts";
@@ -78,10 +79,7 @@ export const ThreadToolkitHandlersLive = ThreadToolkit.toLayer({
7879
threads,
7980
projection: { thread },
8081
} = yield* readWritableThread();
81-
const type =
82-
thread.modelSelection.instanceId === input.modelSelection.instanceId
83-
? "thread.model-selection.set"
84-
: "provider.switch";
82+
const type = modelSelectionCommandType(thread.providerInstanceId, input.modelSelection);
8583
const result = yield* threads
8684
.dispatch({
8785
type,

0 commit comments

Comments
 (0)