This commit is contained in:
+42
-2
@@ -17,7 +17,16 @@ const providerID = Provider.ID.make("test");
|
||||
function model(id: string): ModelInfo {
|
||||
return Model.Info.default(providerID, Model.ID.make(id));
|
||||
}
|
||||
const allModels = ["gpt-5.6-luna", "gpt-5.6-sol", "gpt-6-astra"].map(model);
|
||||
function reasoningModel(id: string): ModelInfo {
|
||||
return {
|
||||
...model(id),
|
||||
variants: ["low", "medium", "high"].map((effort) => ({
|
||||
id: Model.VariantID.make(effort),
|
||||
settings: { reasoningEffort: effort },
|
||||
})),
|
||||
};
|
||||
}
|
||||
const allModels = ["gpt-5.6-luna", "gpt-5.6-sol", "gpt-6-astra"].map(reasoningModel);
|
||||
const cleanups: Plugin.Cleanup[] = [];
|
||||
afterEach(async () => {
|
||||
for (const cleanup of cleanups.splice(0)) await cleanup();
|
||||
@@ -609,7 +618,8 @@ test("reasoning settings and Luna priority use native advertised or official sup
|
||||
settings: { baseURL: "https://api.openai.com/v1" },
|
||||
};
|
||||
const ordinary = await host();
|
||||
expect(ordinary.agents.get("fast-lo")?.request.settings).toEqual({ reasoningEffort: "low" });
|
||||
expect(ordinary.agents.get("fast-lo")?.request.settings).toEqual({});
|
||||
expect(String(ordinary.agents.get("fast-lo")?.model?.variant)).toBe("low");
|
||||
const official = await host([luna, ...allModels.slice(1)]);
|
||||
expect(official.agents.get("fast-hi")?.request.settings).toEqual({
|
||||
reasoningEffort: "high",
|
||||
@@ -632,13 +642,43 @@ test("reasoning settings and Luna priority use native advertised or official sup
|
||||
expect(disabled.agents.get("fast-lo")?.request.settings).toEqual({ reasoningEffort: "low" });
|
||||
});
|
||||
|
||||
test("coordinator defaults expose their effort variant without relying on it for requests", async () => {
|
||||
for (const options of [{ provider: "test" }, { mode: "gpt", provider: "test" }] as const) {
|
||||
const result = await host(allModels, options);
|
||||
expect(result.agents.get("coordinate")?.model).toMatchObject({
|
||||
id: "gpt-6-astra",
|
||||
variant: "medium",
|
||||
});
|
||||
expect(result.agents.get("coordinate")?.request.settings.reasoningEffort).toBeUndefined();
|
||||
}
|
||||
|
||||
const fallback = await host(allModels.slice(0, 2));
|
||||
expect(fallback.agents.get("coordinate")?.model).toMatchObject({
|
||||
id: "gpt-5.6-sol",
|
||||
variant: "medium",
|
||||
});
|
||||
expect(fallback.agents.get("coordinate")?.request.settings.reasoningEffort).toBeUndefined();
|
||||
|
||||
const custom = await host([...allModels, model("local")], {
|
||||
mode: "custom",
|
||||
provider: "test",
|
||||
agents: { ...gptAgents, coordinate: { model: "local", effort: "xhigh" } },
|
||||
});
|
||||
expect(custom.agents.get("coordinate")?.model?.variant).toBeUndefined();
|
||||
expect(custom.agents.get("coordinate")?.request.settings.reasoningEffort).toBe("xhigh");
|
||||
});
|
||||
|
||||
test("catalog updates activate late models and remove unavailable agents", async () => {
|
||||
const result = await host([]);
|
||||
await result.refresh(allModels);
|
||||
expect(String(result.agents.get("coordinate")?.model?.id)).toBe("gpt-6-astra");
|
||||
expect(String(result.agents.get("coordinate")?.model?.variant)).toBe("medium");
|
||||
expect(result.agents.get("coordinate")?.request.settings.reasoningEffort).toBeUndefined();
|
||||
await result.refresh(allModels.slice(0, 2));
|
||||
expect(result.agents.has("deep-lo")).toBe(false);
|
||||
expect(String(result.agents.get("coordinate")?.model?.id)).toBe("gpt-5.6-sol");
|
||||
expect(String(result.agents.get("coordinate")?.model?.variant)).toBe("medium");
|
||||
expect(result.agents.get("coordinate")?.request.settings.reasoningEffort).toBeUndefined();
|
||||
await result.refresh([]);
|
||||
expect(result.agents.has("coordinate")).toBe(false);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user