Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): use the fallback model for untargeted delegation #44093

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

Showing 3 changed files with 186 additions and 0 deletions (loading 2).

x
0 of 3 viewed, 3 left
186 additions and 0 deletionsapps/server/src/mcp/OrchestratorMcpService.test.tsModified
View file
@@ -32,6 +32,7 @@
} from "@t3tools/contracts";
import { checkpointWorkspace } from "@t3tools/provider-testing/replayWorkspace";
import { formatThreadLink, hostedThreadLink } from "@t3tools/shared/threadLinks";
+import { derive } from "@t3tools/provider-core/server/IdAllocator";
import * as DateTime from "effect/DateTime";
import * as Deferred from "effect/Deferred";
import * as Duration from "effect/Duration";
@@ -2532,6 +2533,191 @@
+ it.effect.each([
+ { scenario: "usable fallback", active: true, usesFallback: true, refreshes: false },
+ { scenario: "child still preparing", active: true, usesFallback: true, refreshes: false },
+ { scenario: "explicit target", active: true, usesFallback: false, refreshes: false },
+ { scenario: "invalid requested options", active: true, usesFallback: false, refreshes: false },
+ { scenario: "healthy inherited model", active: false, usesFallback: false, refreshes: false },
+ { scenario: "project-disabled fallback", active: false, usesFallback: false, refreshes: false },
+ { scenario: "invalid model", active: false, usesFallback: false, refreshes: true },
+ { scenario: "stale model list", active: false, usesFallback: true, refreshes: true },
+ ])("resolves configured delegation fallback for $scenario", (testCase) =>
+ Effect.gen(function* () {
+ const { scenario, active, usesFallback, refreshes } = testCase;
+ const fallbackId = ProviderInstanceId.make("claudeAgent");
+ const fallbackModel = "claude-sonnet-4-6";
+ const inherited = providerSnapshot({
+ instanceId: codexInstanceId,
+ driver: ProviderDriverKind.make("codex"),