Agent Diagnostic
During a cluster debugging session, all gateway metadata was removed and a fresh gateway was registered as docker-dev. Running openshell gateway select docker-dev printed a green checkmark, but every subsequent command (openshell status, openshell sandbox create) reported "No gateway configured" or "No gateway metadata found for 'openshell'".
Root cause: OPENSHELL_GATEWAY=openshell was set in the shell environment. The env var takes precedence over the persisted selection, so select wrote to disk but the value was never read back. The CLI arg is defined as:
-g, --gateway <GATEWAY> [env: OPENSHELL_GATEWAY=openshell]
Discovered by inspecting echo $OPENSHELL_GATEWAY after select appeared to succeed.
Description
Actual behavior: openshell gateway select <name> succeeds with a green checkmark even when OPENSHELL_GATEWAY is set to a different value. All subsequent commands ignore the selection and resolve the gateway from the env var instead.
Expected behavior: gateway select should detect when OPENSHELL_GATEWAY is set and either:
- Warn that the env var will override the selection, e.g.:
⚠ OPENSHELL_GATEWAY=openshell is set and will override this selection.
Unset it or run: export OPENSHELL_GATEWAY=<name>
- Or refuse to proceed and explain why.
Reproduction Steps
export OPENSHELL_GATEWAY=openshell
openshell gateway add http://127.0.0.1:18080 --name docker-dev
openshell gateway select docker-dev — prints success
openshell status — reports "No gateway configured" (resolves openshell, not docker-dev)
Environment
- OS: macOS (darwin)
- OpenShell: 0.0.37-dev
Agent Diagnostic
During a cluster debugging session, all gateway metadata was removed and a fresh gateway was registered as
docker-dev. Runningopenshell gateway select docker-devprinted a green checkmark, but every subsequent command (openshell status,openshell sandbox create) reported "No gateway configured" or "No gateway metadata found for 'openshell'".Root cause:
OPENSHELL_GATEWAY=openshellwas set in the shell environment. The env var takes precedence over the persisted selection, soselectwrote to disk but the value was never read back. The CLI arg is defined as:Discovered by inspecting
echo $OPENSHELL_GATEWAYafterselectappeared to succeed.Description
Actual behavior:
openshell gateway select <name>succeeds with a green checkmark even whenOPENSHELL_GATEWAYis set to a different value. All subsequent commands ignore the selection and resolve the gateway from the env var instead.Expected behavior:
gateway selectshould detect whenOPENSHELL_GATEWAYis set and either:Reproduction Steps
export OPENSHELL_GATEWAY=openshellopenshell gateway add http://127.0.0.1:18080 --name docker-devopenshell gateway select docker-dev— prints successopenshell status— reports "No gateway configured" (resolvesopenshell, notdocker-dev)Environment