Repository navigation
Description
Summary
The Pi engine reference documents OpenRouter in "Additional providers" with this model form:
engine:
id: pi
model: openrouter/anthropic/claude-sonnet-4
model-provider: openai
env:
OPENAI_BASE_URL: https://openrouter.ai/api/v1
OPENAI_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
network:
allowed: [defaults, openrouter.ai]This does not compile. The model identifier grammar (pkg/workflow/model_identifier.go, MAF spec) allows exactly one slash in provider/model-token, and the model token may not contain a slash. OpenRouter model ids are vendor-prefixed (for example moonshotai/kimi-k3), so the documented openrouter/vendor/model shape always fails:
engine.model: model identifier: character '/' is not allowed in model token "anthropic/claude-sonnet-4" (segment type: model)
Every vendor-prefixed OpenRouter id is therefore unexpressible through engine.model, which is all of them.
There is a second mismatch: pkg/workflow/pi_provider.go registers a native provider openrouter -> OPENROUTER_API_KEY, which suggests model: openrouter/ works without the custom-route env block. It does not: compilation fails with "engine 'pi' provider openrouter has no credential-isolated AWF route; configure engine.model-provider and a compatible custom API target, or explicitly disable the agent sandbox".
Environment
- gh-aw v0.89.21 (gh extension) and v1.2.2 (latest release); both reproduce
- ubuntu-latest, public repository
Reproduction
- Create a workflow with the documented frontmatter above (or any openrouter// model)
- Run
gh aw compile <workflow> - Compilation fails with the model token error above
The only form accepted by the grammar is a single-slash id, for example model: openrouter/kimi-k3 with the custom route env block. It is unclear whether that resolves at runtime to the vendor-prefixed OpenRouter catalog id (moonshotai/kimi-k3) or fails the AWF /reflect exact-id check.
Expected
Either the documented example compiles (grammar accepts provider/vendor/model, or OpenRouter routing resolves bare tokens against the vendor-prefixed catalog), or the docs show the actually supported form and spell out how vendor-prefixed OpenRouter ids are addressed.
Actual
Docs example fails validation on current and latest gh-aw; the native provider registry entry suggests a shorter config that also fails validation; the working subset and its runtime behavior are undocumented.
Activity
ci: run the changelog bot on the Gemini gateway
ci: run the changelog bot on the Gemini gateway
ci: run the changelog bot on the Gemini gateway
ci: run the changelog bot on the Gemini gateway
ci: run the changelog bot on the Gemini gateway
ci: run the changelog bot on the Gemini gateway
jansdhillon commentedon Nov 13, 2026
Confirmed both halves of this, and can answer the open runtime question: the single-slash form does not work either, so there is no supported way to run an OpenRouter model on the pi engine today.
Compile-time.
ParseModelIdentifier(pkg/workflow/model_identifier.go) splits the base on the first slash withstrings.Cut, validates the rest asmodel-token, andreModelToken(^[A-Za-z0-9][A-Za-z0-9_-]*(\.[A-Za-z0-9][A-Za-z0-9_-]*)*$) admits no slash. Soopenrouter/moonshotai/kimi-k3parses as provideropenrouter, model tokenmoonshotai/kimi-k3, and fails withcharacter '/' is not allowed in model token "moonshotai/kimi-k3". The grammar is the only compile-time blocker.Runtime (the question the issue leaves open). The single-slash
openrouter/kimi-k3compiles, but fails the gateway availability check in the agent job. pi_models_json.cjs strips only the leading provider prefix (configuredModel.slice(modelSlash + 1)), leavingkimi-k3, and validatePiModelAvailability looks that bare id up in the endpoint's advertised models. The OpenRouter endpoint only ever advertises vendor-prefixed ids (moonshotai/kimi-k3,openai/gpt-5,anthropic/claude-...); there is no barekimi-k3, so the check fails with "Pi model "kimi-k3" is not advertised by the configured openai proxy endpoint". Verified against the live /api/v1/models catalog (471 models, all kimi ids aremoonshotai/*) and the run's awf-reflect.json (291 models on the openai endpoint, all vendored). The alias path does not help either: the built-inkimialias resolves toopenai/kimi*, which glob-matches nothing because noopenai/-prefixed kimi exists on the endpoint.Net: the vendored form is rejected at compile time and the bare form is rejected at runtime, so no OpenRouter model is expressible on pi. Note the codex engine compiles the vendored form (
model: moonshotai/kimi-k3) without error, so this is specific to the pi/MAF grammar path.A minimal fix that resolves both halves: allow exactly one inner slash in
model-token(a single vendor segment), soopenrouter/moonshotai/kimi-k3parses as provideropenrouter+ modelmoonshotai/kimi-k3. Both the Go parser and the JS availability check already split on the first slash only, so the vendored remainder flows through to the catalog lookup unchanged and matches. The spec (docs/src/content/docs/specs/model-alias-specification.md) would need the model-token rule amended to permit one vendor segment; the prose already anticipates thevendor/modelconvention (section 90). Happy to open a PR for the grammar + spec + a pi engine regression test if that direction sounds right.ci: run the changelog bot on the native gemini engine
55 remaining items
ci: run the changelog bot on the native gemini engine
ci: switch inference back to OpenRouter via the pi engine
ci: add changelog bot (#466)
ci: run the changelog bot on the Gemini gateway
ci: run the changelog bot on the native gemini engine
ci: switch inference back to OpenRouter via the pi engine
ci: run the changelog bot on the Gemini gateway
ci: run the changelog bot on the native gemini engine
ci: switch inference back to OpenRouter via the pi engine
ci: run the changelog bot on the Gemini gateway
ci: run the changelog bot on the native gemini engine
ci: switch inference back to OpenRouter via the pi engine
ci: run the changelog bot on the Gemini gateway
ci: run the changelog bot on the native gemini engine
ci: switch inference back to OpenRouter via the pi engine