c608051b79
Gemini's generateContent API rejects arktype's `{anyOf:[{enum:[...]}]}` string-enum
encoding, `$schema` metadata, and `anyOf` with sibling fields. Port the old
sanitizer back as an isolated module (action/mcp/geminiSanitizer.ts) and gate it
on `isGeminiRouted(ctx)` so non-gemini routes see the original schema. Wires
`resolvedModel` onto ToolContext so the sanitizer can see the upstream specifier.
Also bumps `openai/gpt-codex-mini` alias from the deprecated `codex-mini-latest`
to `gpt-5.1-codex-mini`, matching the openrouter resolve.
Adds a `filter` workflow_dispatch input + MATRIX_FILTER env that restricts the
models-live matrix to aliases matching a substring, so we can iterate on a
single provider (e.g. `filter=gemini`) without paying to run every model.
31 lines
1.1 KiB
TypeScript
31 lines
1.1 KiB
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.
|
|
*
|
|
* set MATRIX_FILTER to a substring to restrict the matrix to matching aliases
|
|
* — useful for iterating on a single provider without paying for every model.
|
|
*
|
|
* usage:
|
|
* node action/test/list-aliases.ts
|
|
* MATRIX_FILTER=gemini node action/test/list-aliases.ts
|
|
*/
|
|
import { modelAliases } from "../models.ts";
|
|
|
|
function agentForSlug(slug: string): "claude" | "opencode" {
|
|
return slug.startsWith("anthropic/") ? "claude" : "opencode";
|
|
}
|
|
|
|
const filter = process.env.MATRIX_FILTER?.trim() ?? "";
|
|
|
|
const matrix = modelAliases
|
|
.filter((alias) => (filter ? alias.slug.toLowerCase().includes(filter.toLowerCase()) : true))
|
|
.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));
|