Problems
Cobra double-prints errors (all commands)
Commands that call status.Fail() AND return fmt.Errorf() produce triple output: status line + Cobra "Error:" on stderr + Cobra usage text. Bash version prints clean message and exits.
Fix: Set SilenceErrors = true and SilenceUsage = true on the root command.
Discarded mutation errors
deploy.go:82 — gw.GatewaySelect() error discarded; if it fails, InferenceGet gives misleading error
teardown.go:78,103 — SandboxDelete/ProviderDelete errors discarded in loops
new.go:170 — SandboxDelete during retry cleanup unchecked
teardown.go:72,92,97 — SandboxList/ProviderList errors discarded; reports "None" when listing actually failed
Fix: Check errors. For teardown loops, at minimum print a warning. For SandboxList/ProviderList, distinguish "empty" from "failed".
os.Exit(1) in library code
internal/preflight/check.go:165 calls os.Exit(1) directly instead of returning an error. Makes the strict-failure path untestable.
Fix: Return ErrPreflightFailed sentinel error; let cmd layer handle exit code.
providers.go ProviderList/InferenceGet results silently discarded
providers.go:140-143 calls gw.ProviderList() and gw.InferenceGet() but discards return values. User sees section headers with no content underneath. Bash shows the full CLI table.
Fix: Use passthrough calls or print the returned names.
Severity: Medium
Found by: 5-dimension code audit (code quality + equivalence review)
Problems
Cobra double-prints errors (all commands)
Commands that call
status.Fail()AND returnfmt.Errorf()produce triple output: status line + Cobra "Error:" on stderr + Cobra usage text. Bash version prints clean message and exits.Fix: Set
SilenceErrors = trueandSilenceUsage = trueon the root command.Discarded mutation errors
deploy.go:82—gw.GatewaySelect()error discarded; if it fails, InferenceGet gives misleading errorteardown.go:78,103—SandboxDelete/ProviderDeleteerrors discarded in loopsnew.go:170—SandboxDeleteduring retry cleanup uncheckedteardown.go:72,92,97—SandboxList/ProviderListerrors discarded; reports "None" when listing actually failedFix: Check errors. For teardown loops, at minimum print a warning. For
SandboxList/ProviderList, distinguish "empty" from "failed".os.Exit(1) in library code
internal/preflight/check.go:165callsos.Exit(1)directly instead of returning an error. Makes the strict-failure path untestable.Fix: Return
ErrPreflightFailedsentinel error; let cmd layer handle exit code.providers.go ProviderList/InferenceGet results silently discarded
providers.go:140-143callsgw.ProviderList()andgw.InferenceGet()but discards return values. User sees section headers with no content underneath. Bash shows the full CLI table.Fix: Use passthrough calls or print the returned names.
Severity: Medium
Found by: 5-dimension code audit (code quality + equivalence review)