fix: preserve agent scope in thinking projections

This commit is contained in:
Dallin Romney
2026-08-20 23:47:31 -07:00
parent ed2b657d6a
commit 6eddb9fd78
4 changed files with 31 additions and 0 deletions
@@ -1,4 +1,5 @@
import { describe, expect, it } from "vitest";
import { resolveThinkingDefaultWithRuntimeCatalog } from "../../model-thinking-default.js";
import {
resolveInitialThinkLevel,
resolveRequestStreamTransportOverrides,
@@ -50,3 +51,30 @@ describe("resolveInitialThinkLevel", () => {
).toBe("high");
});
});
describe("resolveThinkingDefaultWithRuntimeCatalog", () => {
it("preserves agent scope through the runtime-catalog lookup", async () => {
await expect(
resolveThinkingDefaultWithRuntimeCatalog({
cfg: {
agents: {
defaults: {
models: { "openai/gpt-5.5": { params: { thinking: "low" } } },
},
entries: {
audit: {
models: { "openai/gpt-5.5": { params: { thinking: "high" } } },
},
},
},
},
provider: "openai",
model: "gpt-5.5",
agentId: "audit",
loadRuntimeCatalog: async () => [
{ provider: "openai", id: "gpt-5.5", name: "gpt-5.5", reasoning: true },
],
}),
).resolves.toBe("high");
});
});
+1
View File
@@ -65,5 +65,6 @@ export async function resolveThinkingDefaultWithRuntimeCatalog(params: {
model: params.model,
catalog,
agentRuntime: params.agentRuntime,
agentId: params.agentId,
});
}
+1
View File
@@ -1163,6 +1163,7 @@ export function createSessionStatusTool(opts?: {
cfg,
provider: providerForCard,
model: defaultModelForCard,
agentId,
loadRuntimeCatalog: () =>
loadPreparedModelCatalog({
config: cfg,
@@ -115,6 +115,7 @@ async function resolveNativeSlashDefaultThinkingLevel(params: {
cfg: params.cfg,
provider: params.provider,
model: params.model,
agentId: params.agentId,
loadRuntimeCatalog: () =>
loadPreparedModelCatalog({
config: params.cfg,