Repository navigation
fix(store): refuse non-string models.yml header values at the door (RIG-3134) - #2224
Merged
Merged
Conversation
…IG-3134) rejectCredentialModels skipped a providers.<name>.headers value that was not a string, so a mapping, list, number or null value was never checked by isEnvIndirection. It also skipped a headers node that was a list. The installed SDK schema types every header value as a string, so none of these shapes is a valid models.yml. A headers list is worse: the SDK's createLiveConfigHeaders sends each list item under its index as a header name, so a literal secret in a list reaches the request. Both shapes are now refused with the offending path named. Co-authored-by: Matt Wilkinson <matt@rigel.build>
|
😎 This pull request was merged. |
Contributor
Author
|
Review at head
|
|
Compass engineering docs preview: https://compass-comms-rig-3134-model.compass-eng-docs.pages.dev Deployed from |
rigel-mintaka
marked this pull request as ready for review
October 12, 2026 03:08
mattwilkinsonn
added this pull request to stack #2241
October 12, 2026 19:18
mattwilkinsonn
approved these changes
Oct 12, 2026
mattwilkinsonn
deleted the
compass-comms/rig-3134-models-header-shapes
branch
October 12, 2026 19:18
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
rejectCredentialModels(go/internal/store/agent_config.go) skipped aproviders.<name>.headersvalue that was not a string, soisEnvIndirectionnever checked it. It also skipped aheadersnode that was not a mapping.It now refuses both shapes, and the error names the offending path:
@oh-my-pi/pi-coding-agent@18.0.11,{ "[string]": "string" }) rejects all of these, so no valid models.yml is affected.headersnode that is a list. The SDK schema accepts it.createLiveConfigHeadersthen sends each item under its index (probe:["Bearer sk-live-123"]→{"0":"Bearer sk-live-123"}), so a literal secret in a list reached the request. This was a real gap.headers: {}andheaders: ~still pass. New accept cases pin this, because the guard relies onyamlMapEntriesreturning a non-nil empty slice.headers: []is now refused even though it sends nothing. A list is never a valid header map, so I chose this on purpose.Tests
TestValidateConfigBundleRejectsCredentialKeysfailed on main and pass now.models headers list; skipping non-string values again fails the 4 value-shape cases; refusing an empty mapping failsmodels.yml empty headers mapping.go test ./internal/store/passes.golangci-lintreports 0 issues.go vetis clean.Out of scope
models[].headersandmodelOverrides.<id>.headerspass the door entirely. The SDK sends them the same way. Filed as RIG-5287.Spec-impact: none
Ledger-impact: none
Closes RIG-3134
Co-authored-by: Matt Wilkinson matt@rigel.build