Skip to content

fix(cli): warn when env gateway overrides selection#1219

Merged
johntmyers merged 1 commit into
mainfrom
fix/1206-gateway-select-env-warning/johntmyers
May 6, 2026
Merged

fix(cli): warn when env gateway overrides selection#1219
johntmyers merged 1 commit into
mainfrom
fix/1206-gateway-select-env-warning/johntmyers

Conversation

@johntmyers
Copy link
Copy Markdown
Collaborator

🏗️ build-from-issue-agent

Summary

Warn when openshell gateway select <name> saves a new active gateway while OPENSHELL_GATEWAY is 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 -g and OPENSHELL_GATEWAY override 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_warning passes
  • RUSTC_WRAPPER= mise run pre-commit passes
  • Unit tests added/updated
  • E2E tests not needed (no e2e/ changes)

Tests added:

  • Unit: crates/openshell-cli/src/run.rs covers warning generation when OPENSHELL_GATEWAY masks the selected gateway and no warning when it matches.
  • Integration: N/A
  • E2E: N/A

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

Documentation updated:

  • docs/sandboxes/manage-gateways.mdx: gateway precedence and env override warning behavior.

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>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

@johntmyers johntmyers merged commit fb472f5 into main May 6, 2026
25 checks passed
@johntmyers johntmyers deleted the fix/1206-gateway-select-env-warning/johntmyers branch May 6, 2026 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: gateway select silently succeeds when OPENSHELL_GATEWAY env var overrides selection

2 participants