Repository navigation
Gateway - Check new settings against new secrets - #138
Open
awheeler294 wants to merge 2 commits into
Open
awheeler294 wants to merge 2 commits into
awheeler294 wants to merge 2 commits into
Conversation
Member
|
This sounds ok, I wouldn't overthink it, we know the Gateway has significant problems in its config model. |
This branch has not been deployed
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 is the first part of a series of improvements to config handling in the Gateway, the full plan is in vibe/2026-10-06-1-restart-to-apply.md
Check new settings against new secrets
Currently, adding a model from the Cloud Models page fails if its provider's API key was entered on the Secrets tab after the gateway started, even once that key has been applied. After this change config edits will be checked against both current keys and any pending 'Saved' or 'Applied' keys, so the model can be added straight with its key without a restart.
Problem
A new provider's API key cannot be used until the gateway has restarted with it:
ANTHROPIC_API_KEYdefined on the secrets tab.ANTHROPIC_API_KEYand save. Optionally click 'Apply'UnresolvedVarforANTHROPIC_API_KEY, and nothing is staged.After 'Save' the value is stored in
gateway.env.next, and after 'Apply' it's ingateway.env, but in either case the running process has not read it. The Gateway only reads it's config at startup, and does not "remember" newly added keys, and only validates cloud providers against the keys it read at boot.Solution
This change adds a
PendingEnvstruct that allows the validation to check against pending values that have been 'Saved' and 'Applied'. Functions responsible for interpolating config variables get an argument that lets the inject a function to control what environment they are reading from (current or pending)