Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): continue work after agent model changes #15313

ClosedPixPMusic(GitHub profile, opens in a new tab)wants to merge 13 commits intomain fromrefs/pull/15313/headopened View on GitHub

Showing 8 changed files with 39 additions and 5 deletions (loading 5).

x
0 of 8 viewed, 8 left
25 additions and 4 deletionsapps/server/src/mcp/toolkits/thread/handlers.tsModified
View file
@@ -8,7 +8,6 @@
type OrchestrationV2Command,
} from "@t3tools/contracts";
import * as Effect from "effect/Effect";
-import { modelSelectionCommandType } from "@t3tools/shared/model";
​
import * as McpInvocationContext from "../../McpInvocationContext.ts";
import * as McpToolAccess from "../../McpToolAccess.ts";
@@ -218,10 +217,32 @@
threads,
projection: { thread },
} = yield* readThread(input.threadId);
- const type = modelSelectionCommandType(thread.providerInstanceId, modelSelection);
const result = yield* threads
- .dispatch({ type, threadId: thread.id, commandId: yield* newCommandId(), modelSelection })
- .pipe(Effect.mapError(dispatchFailure));
+ .configureModelSelection({
+ projectId: thread.projectId,
+ threadId: thread.id,
+ commandId: yield* newCommandId(),
+ modelSelection,
+ createdBy: "agent",
+ creationSource: "mcp",
+ })
+ .pipe(
+ Effect.mapError((error) => {
+ switch (error._tag) {
+ case "ThreadManagementThreadArchivedError":
+ return new OrchestratorMcpFailure({