5e6ff67623
PR CI kept breaking on upstream catalog drift (new model ships on models.dev, OpenRouter renames an id, etc.) — failures unrelated to the PR's contents. split the model-alias test suite so PRs only see pure-logic checks, and push the external-state drift + end-to-end coverage to main. test organization: - action/test/models.test.ts keeps pure invariants: openRouterResolve completeness and fallback-chain resolution. runs on every PR. - action/test/models-catalog.main.test.ts gets the 4 network-dependent describes (models.dev validity x2, OpenRouter API validity, latest-model snapshot). runs only on main push via a dedicated vitest config (vitest.main.config.ts + `pnpm test:catalog`). new CI jobs in .github/workflows/test.yml: - models-catalog: `pnpm test:catalog` on every main push. detects upstream catalog drift so we can react at the next convenient window. - models-live: 38-entry matrix that invokes the agent harness end-to-end against the real provider for each alias in models.ts. generated from action/test/list-aliases.ts. runs only on main push AND only when resolution-affecting files changed (action/models.ts, action/package.json, action/agents/**) — the exact shape of the opus 4.7 incident. test/run.ts: PULLFROG_MODEL now flows through from process.env so the live matrix can pin an alias per job without the per-agent default clobbering it. Made-with: Cursor
22 lines
706 B
TypeScript
22 lines
706 B
TypeScript
/**
|
|
* emits a JSON array of { slug, agent, name } entries for the `models-live`
|
|
* matrix job. `agent` is auto-derived from the alias provider and matches the
|
|
* harness the runtime would pick in production.
|
|
*
|
|
* usage: `node action/test/list-aliases.ts`
|
|
*/
|
|
import { modelAliases } from "../models.ts";
|
|
|
|
function agentForSlug(slug: string): "claude" | "opencode" {
|
|
return slug.startsWith("anthropic/") ? "claude" : "opencode";
|
|
}
|
|
|
|
const matrix = modelAliases.map((alias) => ({
|
|
slug: alias.slug,
|
|
agent: agentForSlug(alias.slug),
|
|
// readable display name (GHA renders slashes awkwardly in matrix job titles)
|
|
name: alias.slug.replace("/", "-"),
|
|
}));
|
|
|
|
process.stdout.write(JSON.stringify(matrix));
|