Repository navigation
fix(store): check model-level headers at the models.yml door (RIG-5287) - #2227
Merged
mattwilkinsonn merged 1 commit intoOct 12, 2026
Conversation
rejectCredentialModels checked providers.<name>.headers only. The SDK also reads providers.<name>.models[].headers and providers.<name>.modelOverrides.<id>.headers, merges them onto the provider's headers, and resolves each value through resolveConfigValue. A literal secret at either site passed the door. The header rule moves into rejectCredentialHeaders, and all three sites call it, with the offending path named (models[i] or modelOverrides.<id>). The design record gains a dated amendment naming the extra sites. Co-authored-by: Matt Wilkinson <matt@rigel.build>
Contributor
Author
|
Review at head
|
|
Compass engineering docs preview: https://compass-comms-rig-5287-model.compass-eng-docs.pages.dev Deployed from Changed pages: |
rigel-mintaka
marked this pull request as ready for review
October 12, 2026 03:49
mattwilkinsonn
added this pull request to stack #2241
October 12, 2026 19:18
mattwilkinsonn
approved these changes
Oct 12, 2026
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.
This PR is part of a stack containing 2 PRs:
mainWhat
The models.yml credential door (
rejectCredentialModels,go/internal/store/agent_config.go) checked header values only atproviders.<name>.headers. The installed SDK (@oh-my-pi/pi-coding-agent@18.0.11) reads headers from two more sites and sends them the same way, throughcreateLiveConfigHeaders→resolveConfigValue:providers.<name>.models[].headers(mergeCustomModelHeaders,custom-models.ts)providers.<name>.modelOverrides.<id>.headersOn main, the door accepted a literal secret at either site.
rejectCredentialHeaders, and all three sites call it. Errors name the path, for exampleproviders.x.models[1].headers.X-Keyorproviders.x.modelOverrides.m.headers.Authorization.providersormodelOverridesnode is refused. The SDK schema coerces a list at a record-typed node into an index-keyed record. Probes:providers: [{apiKey: sk-…}]→{"0": {apiKey: …}}, accepted.modelOverrideslist →{"0": {headers: …}}, accepted.providersalso bypassed the apiKey check. That gap predates this PR, and the same rule closes it here.Stacked on #2224 (RIG-3134), which has the same function and the same header rule.
Tests
TestValidateConfigBundleRejectsModelsHeaderShapes(funlen), sharingassertBundleRejects.models[]loop, skipping themodelOverridesloop, dropping theprovidersnon-mapping refusal, and dropping themodelOverridesnon-mapping refusal.!commandreferences at model level.go test ./internal/store/passes,golangci-lintreports 0 issues,rumdlis clean, and the design-ledger-gate passes.Out of scope
compat.extraBodyand credentials embedded in URLs are not CP-4 surfaces today. That scope decision is RIG-5292, assigned to Matt.Spec-impact: none (design-record amendment only)
Ledger-impact: none
Closes RIG-5287
Co-authored-by: Matt Wilkinson matt@rigel.build