Update footer test for big-pickle BYOK fallback.
This commit is contained in:
committed by
pullfrog[bot]
parent
7c5ed7add0
commit
58e5b74cb8
@@ -360,6 +360,7 @@ export const providers = {
|
|||||||
resolve: "opencode/minimax-m2.5-free",
|
resolve: "opencode/minimax-m2.5-free",
|
||||||
envVars: [],
|
envVars: [],
|
||||||
isFree: true,
|
isFree: true,
|
||||||
|
fallback: "opencode/big-pickle",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ const fixture = defineFixture(
|
|||||||
|
|
||||||
function validator(result: AgentResult): ValidationCheck[] {
|
function validator(result: AgentResult): ValidationCheck[] {
|
||||||
const output = getAgentOutput(result);
|
const output = getAgentOutput(result);
|
||||||
const fellBack = /fell back from .* to opencode\/minimax-m2\.5-free/.test(output);
|
const fellBack = /fell back from .* to opencode\/big-pickle/.test(output);
|
||||||
return [
|
return [
|
||||||
{ name: "run_succeeded", passed: result.success },
|
{ name: "run_succeeded", passed: result.success },
|
||||||
{ name: "fallback_logged", passed: fellBack },
|
{ name: "fallback_logged", passed: fellBack },
|
||||||
|
|||||||
@@ -4,17 +4,17 @@ import { buildPullfrogFooter } from "./buildPullfrogFooter.ts";
|
|||||||
describe("buildPullfrogFooter — fallbackFrom annotation", () => {
|
describe("buildPullfrogFooter — fallbackFrom annotation", () => {
|
||||||
it("renders the provider display name when fallbackFrom is set", () => {
|
it("renders the provider display name when fallbackFrom is set", () => {
|
||||||
const footer = buildPullfrogFooter({
|
const footer = buildPullfrogFooter({
|
||||||
model: "opencode/minimax-m2.5-free",
|
model: "opencode/big-pickle",
|
||||||
fallbackFrom: "anthropic/claude-opus",
|
fallbackFrom: "anthropic/claude-opus",
|
||||||
});
|
});
|
||||||
expect(footer).toContain(
|
expect(footer).toContain(
|
||||||
"Using `MiniMax M2.5` (free) (credentials for Anthropic not configured)"
|
"Using `Big Pickle` (free) (credentials for Anthropic not configured)"
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("works for OpenAI's display name too", () => {
|
it("works for OpenAI's display name too", () => {
|
||||||
const footer = buildPullfrogFooter({
|
const footer = buildPullfrogFooter({
|
||||||
model: "opencode/minimax-m2.5-free",
|
model: "opencode/big-pickle",
|
||||||
fallbackFrom: "openai/gpt",
|
fallbackFrom: "openai/gpt",
|
||||||
});
|
});
|
||||||
expect(footer).toContain("(credentials for OpenAI not configured)");
|
expect(footer).toContain("(credentials for OpenAI not configured)");
|
||||||
@@ -22,7 +22,7 @@ describe("buildPullfrogFooter — fallbackFrom annotation", () => {
|
|||||||
|
|
||||||
it("falls back to the raw provider key when the slug provider is unknown to the catalog", () => {
|
it("falls back to the raw provider key when the slug provider is unknown to the catalog", () => {
|
||||||
const footer = buildPullfrogFooter({
|
const footer = buildPullfrogFooter({
|
||||||
model: "opencode/minimax-m2.5-free",
|
model: "opencode/big-pickle",
|
||||||
fallbackFrom: "some-unknown/model",
|
fallbackFrom: "some-unknown/model",
|
||||||
});
|
});
|
||||||
expect(footer).toContain("(credentials for some-unknown not configured)");
|
expect(footer).toContain("(credentials for some-unknown not configured)");
|
||||||
|
|||||||
@@ -4,15 +4,14 @@ import { hasProviderKey } from "./apiKeys.ts";
|
|||||||
* Slug we fall back to when a BYOK-required model is configured but the
|
* Slug we fall back to when a BYOK-required model is configured but the
|
||||||
* runner has no provider key in env. Picked because it's free
|
* runner has no provider key in env. Picked because it's free
|
||||||
* (`isFree: true`, `envVars: []` — see `action/models.ts`), stable, and
|
* (`isFree: true`, `envVars: []` — see `action/models.ts`), stable, and
|
||||||
* currently the strongest free OpenCode model in the catalog. If a
|
* currently served by OpenCode Zen without a key.
|
||||||
* smarter free model is added later, update this single constant.
|
|
||||||
*
|
*
|
||||||
* The slug is intentionally hard-coded and not a config knob — the
|
* The slug is intentionally hard-coded and not a config knob — the
|
||||||
* fallback is a safety net, not a user-facing preference, and adding a
|
* fallback is a safety net, not a user-facing preference, and adding a
|
||||||
* config surface here would just push the same "what to fall back to"
|
* config surface here would just push the same "what to fall back to"
|
||||||
* decision into another setting that goes stale the same way.
|
* decision into another setting that goes stale the same way.
|
||||||
*/
|
*/
|
||||||
export const FREE_FALLBACK_SLUG = "opencode/minimax-m2.5-free";
|
export const FREE_FALLBACK_SLUG = "opencode/big-pickle";
|
||||||
|
|
||||||
export type FallbackDecision = { fallback: false } | { fallback: true; from: string; to: string };
|
export type FallbackDecision = { fallback: false } | { fallback: true; from: string; to: string };
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user