Summary
brev exec <selected-environment> --host <command> does not keep transport resolution bounded to the selected environment after SSH fails.
With Brev CLI v0.6.331 on a Brev CPU environment whose inventory reports RUNNING, HEALTHY, SHELL READY, and build complete:
- Selecting by environment ID makes the fast path try a synthetic
<environment-id>-host SSH alias before resolving the environment. That alias does not resolve.
- Selecting by the adapter-resolved workspace name reaches the published host SSH endpoint but times out.
- Either failure enters the fallback path, performs a global SSH refresh, and queries/enriches unrelated running legacy workspaces instead of returning a bounded diagnostic for the selected target.
The retries were stopped. The remote command did not run and the selected host was not changed.
Public reproducer
Use any selected Brev CPU environment for which inventory is healthy/ready but host SSH is unavailable. Do not substitute another workspace when it fails.
brev exec <environment-id> --host 'nemoclaw host probe --json'
brev exec <workspace-name> --host 'nemoclaw host probe --json'
Expected: both identifiers resolve to the same selected environment and either run the command once or return one bounded selected-target transport error.
Observed: the ID path first synthesizes an unresolved -host alias; the name path times out at the published endpoint; fallback then scans unrelated workspaces.
Code evidence
This is owned by the Brev CLI adapter:
pkg/cmd/exec/exec.go constructs the first SSH target directly from the raw argument and appends -host before resolving name or ID.
- On any failed fast-path SSH attempt for a
RUNNING workspace, runExecCommand calls refresh.RunRefreshAsync.
pkg/cmd/refresh/sshaccess.go obtains GetContextWorkspaces(), then calls the environment and network APIs for every running workspace before refresh writes the generated SSH configuration.
- The relevant
exec.go and sshaccess.go blobs are identical at tag v0.6.331 and current main, so this is not already fixed there.
Related but not duplicate:
Expected behavior
For an explicitly supplied name or ID, brev exec --host should:
- Resolve exactly that environment before choosing a host SSH target.
- Use the adapter/control-plane SSH access contract for that selected environment.
- Run the requested command exactly once when transport succeeds.
- On missing alias, endpoint timeout, or other transport failure, return a bounded diagnostic for the selected environment, including the distinction between inventory readiness and end-to-end SSH reachability.
- Avoid querying, probing, or rewriting SSH configuration for unrelated workspaces.
- Avoid executing the remote command when transport admission fails.
A global brev refresh can remain an explicit operator action, but it should not be an implicit fallback for a selected-target read-only exec.
Acceptance criteria
Qualification removal condition
The blocker is removable when an adapter-supported Brev CLI release can run the public read-only nemoclaw host probe --json through brev exec ... --host on the selected environment without scanning unrelated workspaces or requiring brev refresh.
Boundaries
This report intentionally excludes private environment selectors, SSH addresses, credentials, and raw logs. No workflow dispatch, feedback export, SSH-config modification, credential change, or host mutation was performed.
Summary
brev exec <selected-environment> --host <command>does not keep transport resolution bounded to the selected environment after SSH fails.With Brev CLI v0.6.331 on a Brev CPU environment whose inventory reports
RUNNING,HEALTHY,SHELL READY, and build complete:<environment-id>-hostSSH alias before resolving the environment. That alias does not resolve.The retries were stopped. The remote command did not run and the selected host was not changed.
Public reproducer
Use any selected Brev CPU environment for which inventory is healthy/ready but host SSH is unavailable. Do not substitute another workspace when it fails.
Expected: both identifiers resolve to the same selected environment and either run the command once or return one bounded selected-target transport error.
Observed: the ID path first synthesizes an unresolved
-hostalias; the name path times out at the published endpoint; fallback then scans unrelated workspaces.Code evidence
This is owned by the Brev CLI adapter:
pkg/cmd/exec/exec.goconstructs the first SSH target directly from the raw argument and appends-hostbefore resolving name or ID.RUNNINGworkspace,runExecCommandcallsrefresh.RunRefreshAsync.pkg/cmd/refresh/sshaccess.goobtainsGetContextWorkspaces(), then calls the environment and network APIs for every running workspace before refresh writes the generated SSH configuration.exec.goandsshaccess.goblobs are identical at tag v0.6.331 and currentmain, so this is not already fixed there.Related but not duplicate:
systemctl restart netbird) #426 tracks a stale NetBird gateway path after a network interruption; it does not address ID alias synthesis or selected-target-only fallback.Expected behavior
For an explicitly supplied name or ID,
brev exec --hostshould:A global
brev refreshcan remain an explicit operator action, but it should not be an implicit fallback for a selected-target read-onlyexec.Acceptance criteria
--hostnever blindly treats<raw-environment-id>-hostas an SSH alias.Qualification removal condition
The blocker is removable when an adapter-supported Brev CLI release can run the public read-only
nemoclaw host probe --jsonthroughbrev exec ... --hoston the selected environment without scanning unrelated workspaces or requiringbrev refresh.Boundaries
This report intentionally excludes private environment selectors, SSH addresses, credentials, and raw logs. No workflow dispatch, feedback export, SSH-config modification, credential change, or host mutation was performed.