mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 17:24:32 +00:00
Gateway tests: accept allowlisted refs absent from catalog
This commit is contained in:
@@ -243,6 +243,38 @@ describe("gateway sessions patch", () => {
|
|||||||
expect(res.entry.modelOverride).toBe("claude-sonnet-4-6");
|
expect(res.entry.modelOverride).toBe("claude-sonnet-4-6");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("accepts explicit allowlisted refs absent from bundled catalog", async () => {
|
||||||
|
const store: Record<string, SessionEntry> = {};
|
||||||
|
const cfg = {
|
||||||
|
agents: {
|
||||||
|
defaults: {
|
||||||
|
model: { primary: "openai/gpt-5.2" },
|
||||||
|
models: {
|
||||||
|
"anthropic/claude-sonnet-4-6": { alias: "sonnet" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
} as OpenClawConfig;
|
||||||
|
|
||||||
|
const res = await applySessionsPatchToStore({
|
||||||
|
cfg,
|
||||||
|
store,
|
||||||
|
storeKey: "agent:main:main",
|
||||||
|
patch: { key: "agent:main:main", model: "anthropic/claude-sonnet-4-6" },
|
||||||
|
loadGatewayModelCatalog: async () => [
|
||||||
|
{ provider: "anthropic", id: "claude-sonnet-4-5", name: "Claude Sonnet 4.5" },
|
||||||
|
{ provider: "openai", id: "gpt-5.2", name: "GPT-5.2" },
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(res.ok).toBe(true);
|
||||||
|
if (!res.ok) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
expect(res.entry.providerOverride).toBe("anthropic");
|
||||||
|
expect(res.entry.modelOverride).toBe("claude-sonnet-4-6");
|
||||||
|
});
|
||||||
|
|
||||||
test("sets spawnDepth for subagent sessions", async () => {
|
test("sets spawnDepth for subagent sessions", async () => {
|
||||||
const store: Record<string, SessionEntry> = {};
|
const store: Record<string, SessionEntry> = {};
|
||||||
const res = await applySessionsPatchToStore({
|
const res = await applySessionsPatchToStore({
|
||||||
|
|||||||
Reference in New Issue
Block a user