mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-25 03:45:46 -06:00
fix: preserve agent scope in thinking projections
This commit is contained in:
@@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -65,5 +65,6 @@ export async function resolveThinkingDefaultWithRuntimeCatalog(params: {
|
||||
model: params.model,
|
||||
catalog,
|
||||
agentRuntime: params.agentRuntime,
|
||||
agentId: params.agentId,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user