Store no upstream for an id in the host's own namespace #740 (GitHub #739)
main fromfix/self-namespace-upstream·merged by tombeckenham View on GitHubRoot cause#
namespacedUpstreamIdentity (src/server/providers/upstream-model.ts) splits maker/model at the first slash. An id in the host's own namespace therefore names the host as its own upstream: groq/compound on Groq, and openrouter/auto on OpenRouter. That puts false evidence in models.upstream_provider. No link came of it, because the target would have to be the row's own provider. But a stated row is kept out of the name tier (#736), and the evidence was simply wrong.
Fix#
The fix sits in the one place every adapter's evidence is accepted: pollProviderModels, where info.upstream or upstreamModelIdentity is read. Evidence whose namespace resolves to the polled provider is dropped there, so the row stores none.
The new ownNamespaces(db, providerId) in model-identity.ts resolves namespaces the same way reconcileSameAs does. A namespace counts as the provider's own when it is the provider id, or a name in provider_model_namespaces that only this provider claims and that is no provider's id. Nothing in it is a typed list.
The guard covers every caller of the helper: OpenRouter (including the :variant path), Groq, Together, Hugging Face, Perplexity, Novita, Lovable and Vercel. It also covers the custom identity functions of Azure, Bedrock and Vertex Anthropic. Rows that already hold self evidence are cleared on their next poll, because a changed identity is always written.
Rows affected#
Real ids on the public listings as of 2026-11-21:
- OpenRouter:
openrouter/auto,auto-code,auto-beta,fusion,pareto-code,freeandbodybuilder. - Groq:
groq/compoundandgroq/compound-mini. - Perplexity: its
perplexity/*ids. The adapter already returned null for these through a prefix check, which is now redundant but left in place. - Others: the public Vercel, Hugging Face and Novita listings have no self-namespaced ids. Together and Lovable need keys to list, and their test fixtures have none.
firstParty and the name tier for such a row#
- firstParty: unchanged, still
null. It never reads upstream evidence, only the served link andmaker, and neither Groq nor OpenRouter is a declared maker. - Name tier: now unstated, the row goes to the name tier with key
compound,autoand so on. It links only when one maker's own row elsewhere has that id or alias. None does, sosameAsstays null. The test asserts both.
Tests (model-identity.worker.test.ts)#
- One real id per adapter on the helper. Self-namespaced ids store no evidence, and other-maker ids keep theirs.
- Stored self evidence is cleared on the next poll.
ownNamespacesreads gemini asgemini/google/google-ai-studioand vercel as itself.- Without the poll change, the first two tests fail.
- 1
Warning
Review limit reached#
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 32 minutes.
View limit details
-
Limit details: You’ve used the included review currently available.
Review configuration:
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
0671f625-9704-4c79-bdd6-9d7e80ffabb3
Commits-
Reviewing files that changed from the base of the PR and between 921e344a64385ef61c260069433846e62f7138d4 and 9f8dda7ead306c2b9439f894794c4648b445cd30.
Files selected for processing: 3-
src/server/ingest/model-identity.tssrc/server/ingest/model-identity.worker.test.tssrc/server/ingest/poll-models.ts
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
-
tombeckenham merged thisaaf0f8a
tombeckenham closed this
Sign in to join this conversation.
⚠️ No Changeset found#
Latest commit: 9f8dda7ead306c2b9439f894794c4648b445cd30
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR