Repository navigation
Description
Client or integration
Other — Pi using the OpenCodex-exported provider
Area
Catalog / models
Summary
The Pi catalog export changes OpenRouter's nested model ID openrouter/free into openrouter-free. Pi then sends a selector the proxy cannot route and OpenRouter rejects with HTTP 400. Sending the canonical selector with the nested slash works.
Reproduction
- Configure the OpenRouter provider in OpenCodex and enable the router model ID
openrouter/free. - Start OpenCodex with
ocx start --port 10100and requestGET http://127.0.0.1:10100/v1/models. Confirm the model is exposed asopenrouter/openrouter/free(provider namespace plus the full upstream slug). - Run
ocx export --client pi --jsonand inspectproviders.opencodex.models. The row is exported withid: openrouter/openrouter-freeand nameopenrouter/free (openrouter). - Send a Chat Completions request to
http://127.0.0.1:10100/v1/chat/completionswithmodel: openrouter/openrouter-free. The proxy returns HTTP 400 withProvider error 400: openrouter/openrouter-free is not a valid model ID. - Send the same request with
model: openrouter/openrouter/free. It succeeds and the response identifies a concrete:freemodel. This demonstrates that the exported ID changes the upstream selector.
Version
OpenCodex 2.94.0
Operating system
macOS 26.7.1
Provider and model
OpenRouter / openrouter/free
Logs or error output
Provider error 400: openrouter/openrouter-free is not a valid model ID
Redacted configuration
Pi's generated models.json contains the provider opencodex; its OpenRouter row has ID openrouter/openrouter-free. The OpenRouter credential is configured in OpenCodex and is intentionally omitted.
Checks
- I searched existing issues and documentation.
- I removed secrets, tokens, account details, request credentials, and personal data.
Related pull request
Fix proposed in #8171: the Pi serializer preserves the canonical provider/model selector, including nested upstream slashes. It leaves synthetic Fast selectors and other client serializers unchanged, adds regression coverage, and updates the Pi and architecture documentation. The PR targets dev.
Activity
github-actions commentedon Nov 4, 2026
Automated translation bookkeeping — detected language: English.
github-actions commentedon Nov 4, 2026
Potential duplicates found:
openrouter/freeinto an invalid model ID #8168Reason: Issue 8168 reports the same root cause: the Pi catalog export rewrites the nested OpenRouter slug 'openrouter/free' into the invalid ID 'openrouter-free', causing the upstream to reject the model with HTTP 400, identical to the new issue's
Detected automatically via GitHub Copilot; automatic closure requires separate deterministic evidence.
coderabbitai commentedon Nov 4, 2026
openrouter/freeinto an invalid model ID #8168🔗 Related PRs
#7971 - fix(router): decode routed slugs via modelDisplayNames ids [open]
#7979 - fix(router): decode routed slugs via modelDisplayNames ids [merged]
📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
lidge-jun commentedon Nov 7, 2026
The straightforward Pi-only selector rewrite needs an owner routing-design decision before it is safe to merge. Independent review found that
acme/org/modelcan select the distinct native modelacme/org/modelinstead of the intendedorg/modelwhen both exist; the router gives the full native ID precedence. The draft #8287 head has that regression and must remain unmerged.A local guard that requires the encoded and raw selectors to resolve to the same concrete identity avoids that collision when its configuration is authoritative, but two clean synthetic tests still fail: a live-only model with a cold local inventory keeps the broken encoded selector, and a CLI using saved inventory can approve a raw selector that routes to a different model in the serving proxy's newer inventory. Encoded collisions and synthetic Fast selectors also need an explicit policy.
Owner decision needed: where the serving proxy should establish and carry selector identity for CLI export and managed integration refresh, and how to handle cold or ambiguous encoded selectors and their Fast rows without silently selecting another model or changing endpoint/admission behavior. The issue remains open; #8287 stays draft pending that decision.
fix(clients): prove Pi nested selectors in the serving proxy (#8172)
fix(clients): refresh Pi through the serving proxy and drop native ro…
fix(clients): prove Pi nested selectors in the serving proxy (lidge-j…