fix(cli): warn when env gateway overrides selection#1219
Merged
Conversation
Closes #1206 Warn when gateway select saves a new active gateway while OPENSHELL_GATEWAY is set to a different value, and document the override precedence. Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com>
|
🌿 Preview your docs: https://nvidia-preview-pr-1219.docs.buildwithfern.com/openshell |
TaylorMutch
approved these changes
May 6, 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.
Summary
Warn when
openshell gateway select <name>saves a new active gateway whileOPENSHELL_GATEWAYis set to a different name. The command still succeeds, but the warning explains that the current shell will continue resolving through the env var until it is unset or updated.Related Issue
Closes #1206
Changes
crates/openshell-cli/src/run.rs: adds env-override warning text after successful gateway selection and unit coverage for masked vs matching selection behavior.docs/sandboxes/manage-gateways.mdx: documents that-gandOPENSHELL_GATEWAYoverride the persisted active gateway, including the new warning behavior.Deviations from Plan
None — implemented as planned.
Testing
RUSTC_WRAPPER= cargo test -p openshell-cli gateway_env_override_warningpassesRUSTC_WRAPPER= mise run pre-commitpassese2e/changes)Tests added:
crates/openshell-cli/src/run.rscovers warning generation whenOPENSHELL_GATEWAYmasks the selected gateway and no warning when it matches.Checklist
Documentation updated:
docs/sandboxes/manage-gateways.mdx: gateway precedence and env override warning behavior.