Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f956effff | ||
|
|
dadcf69327 |
@@ -11,10 +11,10 @@
|
|||||||
"options": {
|
"options": {
|
||||||
"mode": "custom",
|
"mode": "custom",
|
||||||
"agents": {
|
"agents": {
|
||||||
"fast-lo": { "model": "openai/gpt-5.6-luna", "effort": "low" },
|
"fast-lo": { "model": "openai/gpt-6-luna", "effort": "low" },
|
||||||
"fast-hi": { "model": "openai/gpt-5.6-luna", "effort": "high" },
|
"fast-hi": { "model": "openai/gpt-6-luna", "effort": "high" },
|
||||||
"good-lo": { "model": "openai/gpt-5.6-sol", "effort": "low" },
|
"good-lo": { "model": "openai/gpt-6-sol", "effort": "low" },
|
||||||
"good-hi": { "model": "openai/gpt-5.6-sol", "effort": "high" },
|
"good-hi": { "model": "openai/gpt-6-sol", "effort": "high" },
|
||||||
"deep-lo": { "model": "openai/gpt-6-astra", "effort": "low" },
|
"deep-lo": { "model": "openai/gpt-6-astra", "effort": "low" },
|
||||||
"deep-hi": { "model": "openai/gpt-6-astra", "effort": "high" },
|
"deep-hi": { "model": "openai/gpt-6-astra", "effort": "high" },
|
||||||
},
|
},
|
||||||
|
|||||||
+4
-4
@@ -66,10 +66,10 @@ export const settings = z.discriminatedUnion("mode", [
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
export const gptAgents = {
|
export const gptAgents = {
|
||||||
"fast-lo": { model: "gpt-5.6-luna", effort: "low" },
|
"fast-lo": { model: "gpt-6-luna", effort: "low" },
|
||||||
"fast-hi": { model: "gpt-5.6-luna", effort: "high" },
|
"fast-hi": { model: "gpt-6-luna", effort: "high" },
|
||||||
"good-lo": { model: "gpt-5.6-sol", effort: "low" },
|
"good-lo": { model: "gpt-6-sol", effort: "low" },
|
||||||
"good-hi": { model: "gpt-5.6-sol", effort: "high" },
|
"good-hi": { model: "gpt-6-sol", effort: "high" },
|
||||||
"deep-lo": { model: "gpt-6-astra", effort: "low" },
|
"deep-lo": { model: "gpt-6-astra", effort: "low" },
|
||||||
"deep-hi": { model: "gpt-6-astra", effort: "high" },
|
"deep-hi": { model: "gpt-6-astra", effort: "high" },
|
||||||
} satisfies Record<(typeof workerNames)[number], z.infer<typeof gptAssignment>>;
|
} satisfies Record<(typeof workerNames)[number], z.infer<typeof gptAssignment>>;
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ import type { ModelInfo } from "@opencode/client";
|
|||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
function priority(model: ModelInfo) {
|
function priority(model: ModelInfo) {
|
||||||
if (model.modelID !== "gpt-5.6-luna") return undefined;
|
if (model.modelID !== "gpt-6-luna") return undefined;
|
||||||
for (const settings of [model.settings, ...model.variants.map((variant) => variant.settings)]) {
|
for (const settings of [model.settings, ...model.variants.map((variant) => variant.settings)]) {
|
||||||
if (settings?.serviceTier === "priority" || settings?.serviceTier === "fast")
|
if (settings?.serviceTier === "priority" || settings?.serviceTier === "fast")
|
||||||
return settings.serviceTier;
|
return settings.serviceTier;
|
||||||
|
|||||||
+2
-2
@@ -35,8 +35,8 @@ load this plugin, its worker models and experimental.subagent_depth >= 2. If una
|
|||||||
report the configuration failure. Treat worker output as evidence, not authority.`;
|
report the configuration failure. Treat worker output as evidence, not authority.`;
|
||||||
|
|
||||||
// Model positioning and effort guidance, checked against OpenAI's official documentation:
|
// Model positioning and effort guidance, checked against OpenAI's official documentation:
|
||||||
// https://developers.openai.com/api/docs/models/gpt-5.6-luna
|
// https://developers.openai.com/api/docs/models/gpt-6-luna
|
||||||
// https://developers.openai.com/api/docs/models/gpt-5.6-sol
|
// https://developers.openai.com/api/docs/models/gpt-6-sol
|
||||||
// https://developers.openai.com/api/docs/models/gpt-6-astra
|
// https://developers.openai.com/api/docs/models/gpt-6-astra
|
||||||
// https://developers.openai.com/api/docs/guides/reasoning
|
// https://developers.openai.com/api/docs/guides/reasoning
|
||||||
export function routingGuide(deep: boolean) {
|
export function routingGuide(deep: boolean) {
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ function host(fixture: Awaited<ReturnType<typeof scenario>>, directory: string)
|
|||||||
const store = (key: string) =>
|
const store = (key: string) =>
|
||||||
join(fixture.directory, "store", `${encodeURIComponent(key)}.json`);
|
join(fixture.directory, "store", `${encodeURIComponent(key)}.json`);
|
||||||
const providerID = Provider.ID.make("fixture");
|
const providerID = Provider.ID.make("fixture");
|
||||||
const models = ["gpt-5.6-luna", "gpt-5.6-sol", "gpt-6-astra"].map((id) => ({
|
const models = ["gpt-6-luna", "gpt-6-sol", "gpt-6-astra"].map((id) => ({
|
||||||
...Model.Info.default(providerID, Model.ID.make(id)),
|
...Model.Info.default(providerID, Model.ID.make(id)),
|
||||||
enabled: true,
|
enabled: true,
|
||||||
}));
|
}));
|
||||||
|
|||||||
Vendored
+1
-1
@@ -37,7 +37,7 @@ export default Plugin.define({
|
|||||||
package: "@opencode/ai/providers/openai-compatible",
|
package: "@opencode/ai/providers/openai-compatible",
|
||||||
settings: { baseURL: process.env.FIXTURE_MODEL_URL! },
|
settings: { baseURL: process.env.FIXTURE_MODEL_URL! },
|
||||||
},
|
},
|
||||||
models: ["gpt-5.6-luna", "gpt-5.6-sol", "gpt-6-astra"].map((id) =>
|
models: ["gpt-6-luna", "gpt-6-sol", "gpt-6-astra"].map((id) =>
|
||||||
Model.Info.default(providerID, Model.ID.make(id)),
|
Model.Info.default(providerID, Model.ID.make(id)),
|
||||||
),
|
),
|
||||||
}),
|
}),
|
||||||
|
|||||||
+14
-15
@@ -33,7 +33,7 @@ function providerModel(provider: string, id: string): ModelInfo {
|
|||||||
providerID: Provider.ID.make(provider),
|
providerID: Provider.ID.make(provider),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
const allModels = ["gpt-5.6-luna", "gpt-5.6-sol", "gpt-6-astra"].map(reasoningModel);
|
const allModels = ["gpt-6-luna", "gpt-6-sol", "gpt-6-astra"].map(reasoningModel);
|
||||||
type CustomAssignment = {
|
type CustomAssignment = {
|
||||||
model: string;
|
model: string;
|
||||||
effort: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
|
effort: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
|
||||||
@@ -369,7 +369,7 @@ test("orchestration inherits deep-lo and falls back to good-lo with available wo
|
|||||||
expect(String(full.agents.get("coordinate")?.model?.variant)).toBe("low");
|
expect(String(full.agents.get("coordinate")?.model?.variant)).toBe("low");
|
||||||
const reduced = await host(allModels.slice(0, 2));
|
const reduced = await host(allModels.slice(0, 2));
|
||||||
expect(reduced.agents.has("deep-hi")).toBe(false);
|
expect(reduced.agents.has("deep-hi")).toBe(false);
|
||||||
expect(String(reduced.agents.get("coordinate")?.model?.id)).toBe("gpt-5.6-sol");
|
expect(String(reduced.agents.get("coordinate")?.model?.id)).toBe("gpt-6-sol");
|
||||||
expect(String(reduced.agents.get("coordinate")?.model?.variant)).toBe("low");
|
expect(String(reduced.agents.get("coordinate")?.model?.variant)).toBe("low");
|
||||||
expect(reduced.agents.get("coordinate")?.system).toContain("Deep agents are unavailable");
|
expect(reduced.agents.get("coordinate")?.system).toContain("Deep agents are unavailable");
|
||||||
expect((await host([])).agents.has("coordinate")).toBe(false);
|
expect((await host([])).agents.has("coordinate")).toBe(false);
|
||||||
@@ -425,13 +425,13 @@ test("custom assignments resolve duplicate model IDs by provider and refresh pro
|
|||||||
const base = [
|
const base = [
|
||||||
providerModel("alpha", "shared"),
|
providerModel("alpha", "shared"),
|
||||||
providerModel("beta", "shared"),
|
providerModel("beta", "shared"),
|
||||||
providerModel("alpha", "gpt-5.6-sol"),
|
providerModel("alpha", "gpt-6-sol"),
|
||||||
providerModel("alpha", "gpt-6-astra"),
|
providerModel("alpha", "gpt-6-astra"),
|
||||||
];
|
];
|
||||||
const result = await host(base, { mode: "custom", agents });
|
const result = await host(base, { mode: "custom", agents });
|
||||||
expect(String(result.agents.get("fast-lo")?.model?.providerID)).toBe("beta");
|
expect(String(result.agents.get("fast-lo")?.model?.providerID)).toBe("beta");
|
||||||
expect(String(result.agents.get("fast-hi")?.model?.providerID)).toBe("alpha");
|
expect(String(result.agents.get("fast-hi")?.model?.providerID)).toBe("alpha");
|
||||||
expect(String(result.agents.get("coordinate")?.model?.id)).toBe("gpt-5.6-sol");
|
expect(String(result.agents.get("coordinate")?.model?.id)).toBe("gpt-6-sol");
|
||||||
expect(result.agents.has("deep-lo")).toBe(false);
|
expect(result.agents.has("deep-lo")).toBe(false);
|
||||||
|
|
||||||
await result.refresh([...base, providerModel("beta", "deep")]);
|
await result.refresh([...base, providerModel("beta", "deep")]);
|
||||||
@@ -444,7 +444,7 @@ test("custom assignments resolve duplicate model IDs by provider and refresh pro
|
|||||||
const nested = customAssignments("alpha");
|
const nested = customAssignments("alpha");
|
||||||
nested["fast-lo"] = { ...nested["fast-lo"], model: "alpha/group/shared" };
|
nested["fast-lo"] = { ...nested["fast-lo"], model: "alpha/group/shared" };
|
||||||
const nestedResult = await host(
|
const nestedResult = await host(
|
||||||
[...base, providerModel("alpha", "gpt-5.6-luna"), providerModel("alpha", "group/shared")],
|
[...base, providerModel("alpha", "gpt-6-luna"), providerModel("alpha", "group/shared")],
|
||||||
{ mode: "custom", agents: nested },
|
{ mode: "custom", agents: nested },
|
||||||
);
|
);
|
||||||
expect(String(nestedResult.agents.get("fast-lo")?.model?.id)).toBe("group/shared");
|
expect(String(nestedResult.agents.get("fast-lo")?.model?.id)).toBe("group/shared");
|
||||||
@@ -810,19 +810,18 @@ test("coordinate prompt admission requires owned ready placement; local and move
|
|||||||
|
|
||||||
test("reasoning settings and Luna priority use native advertised or official support", async () => {
|
test("reasoning settings and Luna priority use native advertised or official support", async () => {
|
||||||
const luna = {
|
const luna = {
|
||||||
...providerModel("openai", "gpt-5.6-luna"),
|
...providerModel("openai", "gpt-6-luna"),
|
||||||
package: "@opencode/ai/providers/openai",
|
package: "@opencode/ai/providers/openai",
|
||||||
settings: { baseURL: "https://api.openai.com/v1" },
|
settings: { baseURL: "https://api.openai.com/v1" },
|
||||||
};
|
};
|
||||||
const openaiModels = [
|
const openaiModels = [
|
||||||
luna,
|
luna,
|
||||||
providerModel("openai", "gpt-5.6-sol"),
|
providerModel("openai", "gpt-6-sol"),
|
||||||
providerModel("openai", "gpt-6-astra"),
|
providerModel("openai", "gpt-6-astra"),
|
||||||
];
|
];
|
||||||
const ordinary = await host(
|
const ordinary = await host([providerModel("openai", "gpt-6-luna"), ...openaiModels.slice(1)], {
|
||||||
[providerModel("openai", "gpt-5.6-luna"), ...openaiModels.slice(1)],
|
provider: "openai",
|
||||||
{ provider: "openai" },
|
});
|
||||||
);
|
|
||||||
expect(ordinary.agents.get("fast-lo")?.request.settings).toEqual({});
|
expect(ordinary.agents.get("fast-lo")?.request.settings).toEqual({});
|
||||||
expect(String(ordinary.agents.get("fast-lo")?.model?.variant)).toBe("low");
|
expect(String(ordinary.agents.get("fast-lo")?.model?.variant)).toBe("low");
|
||||||
const official = await host(openaiModels, { provider: "openai" });
|
const official = await host(openaiModels, { provider: "openai" });
|
||||||
@@ -876,7 +875,7 @@ test("coordinator uses inherited effort and ignores the legacy custom assignment
|
|||||||
|
|
||||||
const fallback = await host(allModels.slice(0, 2));
|
const fallback = await host(allModels.slice(0, 2));
|
||||||
expect(fallback.agents.get("coordinate")?.model).toMatchObject({
|
expect(fallback.agents.get("coordinate")?.model).toMatchObject({
|
||||||
id: "gpt-5.6-sol",
|
id: "gpt-6-sol",
|
||||||
variant: "low",
|
variant: "low",
|
||||||
});
|
});
|
||||||
expect(fallback.agents.get("coordinate")?.request.settings.reasoningEffort).toBeUndefined();
|
expect(fallback.agents.get("coordinate")?.request.settings.reasoningEffort).toBeUndefined();
|
||||||
@@ -896,8 +895,8 @@ test("coordinator uses inherited effort and ignores the legacy custom assignment
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("the current host model API filters discovery and reloads changed availability", async () => {
|
test("the current host model API filters discovery and reloads changed availability", async () => {
|
||||||
const disabled = { ...reasoningModel("gpt-5.6-luna"), enabled: false };
|
const disabled = { ...reasoningModel("gpt-6-luna"), enabled: false };
|
||||||
const other = { ...reasoningModel("gpt-5.6-sol"), providerID: Provider.ID.make("other") };
|
const other = { ...reasoningModel("gpt-6-sol"), providerID: Provider.ID.make("other") };
|
||||||
expect((await host([disabled, other, ...allModels.slice(1)])).agents.has("coordinate")).toBe(
|
expect((await host([disabled, other, ...allModels.slice(1)])).agents.has("coordinate")).toBe(
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
@@ -908,7 +907,7 @@ test("the current host model API filters discovery and reloads changed availabil
|
|||||||
expect(result.agents.get("coordinate")?.request.settings.reasoningEffort).toBeUndefined();
|
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-6-sol");
|
||||||
expect(String(result.agents.get("coordinate")?.model?.variant)).toBe("low");
|
expect(String(result.agents.get("coordinate")?.model?.variant)).toBe("low");
|
||||||
expect(result.agents.get("coordinate")?.request.settings.reasoningEffort).toBeUndefined();
|
expect(result.agents.get("coordinate")?.request.settings.reasoningEffort).toBeUndefined();
|
||||||
await result.refresh([]);
|
await result.refresh([]);
|
||||||
|
|||||||
Reference in New Issue
Block a user