Compare commits
2
Commits
9bd92ba53c
...
v1.3.7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
20f6087340 | ||
|
|
c401290080 |
+10
-4
@@ -168,6 +168,9 @@ export default Plugin.define({
|
|||||||
const assignment = assignments[name];
|
const assignment = assignments[name];
|
||||||
const available = models.get(assignment.model)!;
|
const available = models.get(assignment.model)!;
|
||||||
editor.update(name, (agent) => {
|
editor.update(name, (agent) => {
|
||||||
|
const hasVariant = available.model.variants.some(
|
||||||
|
({ id }) => id === assignment.effort,
|
||||||
|
);
|
||||||
agent.name = Agent.Name.make(name);
|
agent.name = Agent.Name.make(name);
|
||||||
agent.mode = "subagent";
|
agent.mode = "subagent";
|
||||||
agent.hidden = false;
|
agent.hidden = false;
|
||||||
@@ -176,10 +179,9 @@ export default Plugin.define({
|
|||||||
providerID: Provider.ID.make(available.model.providerID),
|
providerID: Provider.ID.make(available.model.providerID),
|
||||||
id: Model.ID.make(available.model.id),
|
id: Model.ID.make(available.model.id),
|
||||||
};
|
};
|
||||||
|
if (hasVariant) agent.model.variant = Model.VariantID.make(assignment.effort);
|
||||||
agent.request = {
|
agent.request = {
|
||||||
settings: {
|
settings: hasVariant ? {} : { reasoningEffort: assignment.effort },
|
||||||
reasoningEffort: assignment.effort,
|
|
||||||
},
|
|
||||||
headers: {},
|
headers: {},
|
||||||
body: {},
|
body: {},
|
||||||
};
|
};
|
||||||
@@ -193,6 +195,9 @@ export default Plugin.define({
|
|||||||
}
|
}
|
||||||
editor.update("coordinate", (agent) => {
|
editor.update("coordinate", (agent) => {
|
||||||
const available = models.get(coordinate.model)!;
|
const available = models.get(coordinate.model)!;
|
||||||
|
const hasVariant = available.model.variants.some(
|
||||||
|
({ id }) => id === coordinate.effort,
|
||||||
|
);
|
||||||
agent.name = Agent.Name.make("coordinate");
|
agent.name = Agent.Name.make("coordinate");
|
||||||
agent.mode = "primary";
|
agent.mode = "primary";
|
||||||
agent.hidden = false;
|
agent.hidden = false;
|
||||||
@@ -202,8 +207,9 @@ export default Plugin.define({
|
|||||||
providerID: Provider.ID.make(available.model.providerID),
|
providerID: Provider.ID.make(available.model.providerID),
|
||||||
id: Model.ID.make(available.model.id),
|
id: Model.ID.make(available.model.id),
|
||||||
};
|
};
|
||||||
|
if (hasVariant) agent.model.variant = Model.VariantID.make(coordinate.effort);
|
||||||
agent.request = {
|
agent.request = {
|
||||||
settings: { reasoningEffort: coordinate.effort },
|
settings: hasVariant ? {} : { reasoningEffort: coordinate.effort },
|
||||||
headers: {},
|
headers: {},
|
||||||
body: {},
|
body: {},
|
||||||
};
|
};
|
||||||
|
|||||||
+42
-2
@@ -17,7 +17,16 @@ const providerID = Provider.ID.make("test");
|
|||||||
function model(id: string): ModelInfo {
|
function model(id: string): ModelInfo {
|
||||||
return Model.Info.default(providerID, Model.ID.make(id));
|
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[] = [];
|
const cleanups: Plugin.Cleanup[] = [];
|
||||||
afterEach(async () => {
|
afterEach(async () => {
|
||||||
for (const cleanup of cleanups.splice(0)) await cleanup();
|
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" },
|
settings: { baseURL: "https://api.openai.com/v1" },
|
||||||
};
|
};
|
||||||
const ordinary = await host();
|
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)]);
|
const official = await host([luna, ...allModels.slice(1)]);
|
||||||
expect(official.agents.get("fast-hi")?.request.settings).toEqual({
|
expect(official.agents.get("fast-hi")?.request.settings).toEqual({
|
||||||
reasoningEffort: "high",
|
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" });
|
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 () => {
|
test("catalog updates activate late models and remove unavailable agents", async () => {
|
||||||
const result = await host([]);
|
const result = await host([]);
|
||||||
await result.refresh(allModels);
|
await result.refresh(allModels);
|
||||||
expect(String(result.agents.get("coordinate")?.model?.id)).toBe("gpt-6-astra");
|
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));
|
await result.refresh(allModels.slice(0, 2));
|
||||||
expect(result.agents.has("deep-lo")).toBe(false);
|
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?.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([]);
|
await result.refresh([]);
|
||||||
expect(result.agents.has("coordinate")).toBe(false);
|
expect(result.agents.has("coordinate")).toBe(false);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user