fix(gateway): honor explicit allowlist refs when bundled catalog is stale#25901
Merged
vincentkoc merged 5 commits intomainfrom Feb 25, 2026
Merged
Conversation
1ed6f39 to
83fee5d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/modelandsessions.patchcould reject an explicitly allowlisted model when that model was absent from the bundled catalog (stale catalog case), andmodels.listcould surface stale entries.agents.defaults.modelsentries could still hitmodel not allowedand get inconsistent picker/runtime behavior.buildAllowedModelSetnow always trusts parseable explicit allowlist refs and synthesizes missing catalog entries for those refs so picker output and runtime checks stay aligned.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
agents.defaults.modelsrefs can now be selected via/modeleven when bundled catalog entries lag behind model releases.models.listnow includes synthetic entries for allowlisted refs absent from bundled catalog data.Security Impact (required)
No)No)No)No)No)Repro + Verification
Environment
models.list,sessions.patch)agents.defaults.modelscontains explicit ref missing from bundled catalogSteps
agents.defaults.modelswithanthropic/claude-sonnet-4-6.anthropic/claude-sonnet-4-5.sessions.patchwithmodel=anthropic/claude-sonnet-4-6and callmodels.list.Expected
sessions.patchaccepts explicit allowlisted ref.models.listincludes the allowlisted ref.Actual
Evidence
Tests run:
pnpm test src/agents/model-selection.test.ts src/gateway/sessions-patch.test.ts src/gateway/server.models-voicewake-misc.test.tspnpm formatHuman Verification (required)
resolveAllowedModelRefandsessions.patch; synthetic allowlist entry surfacing inmodels.list.Compatibility / Migration
Yes)No)No)Failure Recovery (if this breaks)
src/agents/model-selection.tsand related tests/changelog entry.models.listwhen allowlist keys are malformed (guarded by parseability checks).Risks and Mitigations
Greptile Summary
Updated
buildAllowedModelSetto honor explicitly allowlisted model refs even when bundled catalog is stale. Previously,sessions.patchand/modelselection could reject valid allowlisted models absent from the catalog. Now synthesizes missing catalog entries for allowlisted refs to keep picker output and runtime checks aligned.idandnamefields)models.listtest expectation: now returns synthetic entries instead of falling back to full catalogmodel-selection.test.ts,sessions-patch.test.ts, andserver.models-voicewake-misc.test.tsConfidence Score: 5/5
Last reviewed commit: 83fee5d