Skip to content

feat(cli): improve sandbox provisioning status messages and UX - #175

Merged
drew merged 12 commits into
mainfrom
174-sandbox-provisioning-ux/an
Mar 8, 2026
Merged

feat(cli): improve sandbox provisioning status messages and UX#175
drew merged 12 commits into
mainfrom
174-sandbox-provisioning-ux/an

Conversation

@drew

@drew drew commented Mar 8, 2026

Copy link
Copy Markdown
Collaborator

Closes #174

Summary

  • Replace the single-line Phase: Provisioning EVENT ... spinner with a step-based provisioning checklist that maps Kubernetes events to human-readable steps with marks and elapsed times
  • Add upload progress feedback, better SSH connection messaging, timestamped non-interactive output, and context-aware timeout errors

Before

⠋ Phase: Provisioning EVENT Scheduled Successfully assigned...
⠋ Phase: Provisioning EVENT Pulling Pulling image "registry/img:latest"
  Phase: Ready
Connecting...

After (interactive)

Created sandbox:

  Name: my-sandbox
  Namespace: default

  ✓ Scheduled on node (0s)
  ✓ Image pulled (12s)
  ✓ Container created (0s)
  ✓ Container started (0s)
  ✓ Gateway ready (2s)
  ✓ Sandbox ready (18s)

  • Uploading files to /sandbox...
  ✓ Files uploaded
  • Connecting via SSH...

After (non-interactive / CI)

  [0.0s] Created sandbox my-sandbox
  [0.2s] Scheduled on node
  [3.1s] Pulling image registry/img:latest
  [15.4s] Image pulled
  [15.6s] Container started
  [18.2s] Gateway ready
  [18.3s] Sandbox ready

Test Plan

  • cargo test -p navigator-cli — all 50 tests pass
  • cargo check --workspace — clean
  • cargo fmt --all -- --check — clean

@drew drew self-assigned this Mar 8, 2026
drew added 12 commits March 8, 2026 15:58
Replace the single-line spinner with a step-based provisioning checklist
that maps Kubernetes events to human-readable steps (Scheduled, Pulling
image, Image pulled, Container created, Container started, Gateway ready,
Sandbox ready). Each completed step is printed as a persistent checkmark
line with elapsed time.

- Add elapsed time display on spinner and completed steps
- Show image name as detail text during pull
- Add upload progress feedback messages
- Improve non-interactive mode with timestamped step lines
- Include stuck step name in timeout errors
- Improve Connecting message to specify SSH

Closes #174
Consolidate 13+ individual status lines into 4 high-level phases
(Pulling gateway image, Preparing gateway, Starting gateway, Waiting
for gateway) with sub-step details shown only in the spinner during
execution. Add granular progress messages during PKI generation to
avoid the spinner appearing stuck. Rename user-facing 'cluster'
references to 'gateway' throughout the deploy flow.
On success, clear the container log panel from terminal output so the
final result is a clean list of phase checkmarks followed by the
gateway ready summary. On failure, preserve the log panel for
debugging.
Add blank line before 'Gateway ready' to separate it from the phase
checkmarks. Make 'Gateway endpoint:' bold instead of 'Gateway ready:'
to emphasize the actionable information.
Resolve the gateway name using the same priority chain as stop,
destroy, and info: --name flag > --cluster flag > NEMOCLAW_CLUSTER
env > active cluster file > 'nemoclaw' default. Previously, --name
always defaulted to 'nemoclaw', ignoring the env var.
Replace the global --cluster/-c flag with --gateway/-g across the
CLI. Rename internal ClusterContext/resolve_cluster to
GatewayContext/resolve_gateway. Update SshProxy to use --gateway-name
(with --cluster kept as a visible alias for backwards compat). Update
ProxyCommand strings in ssh.rs and navigator-tui. Keep NEMOCLAW_CLUSTER
env var unchanged for backwards compatibility.
In the ssh-proxy subcommand, rename --gateway (URL) to
--gateway-endpoint and --gateway-name (name) to --gateway. This makes
--gateway consistently refer to the gateway name across all
subcommands, while --gateway-endpoint is the explicit URL used in
token mode.
Remove and recreate the Docker network on every deploy instead of
reusing an existing one. Stale networks from interrupted destroys or
Docker Desktop restarts can leave broken routing that causes k3s to
fail with 'no default routes found'. The force-remove handles
disconnecting any lingering containers before deletion.
Docker may briefly report a container as still running after a
force-remove, causing image deletion to fail with a 409 conflict.
Retry up to 5 times with 500ms backoff to handle this race condition
instead of silently leaving stale images behind.
@drew
drew force-pushed the 174-sandbox-provisioning-ux/an branch from 52316ea to a16436b Compare March 8, 2026 23:03
@drew
drew merged commit 61f3e7f into main Mar 8, 2026
10 checks passed
@drew
drew deleted the 174-sandbox-provisioning-ux/an branch March 8, 2026 23:36
johntmyers added a commit that referenced this pull request Mar 10, 2026
The ProxyCommand in handle_shell_connect and handle_exec_command was
using --gateway for the URL, but after the #175 rename --gateway means
cluster name and --gateway-endpoint is the URL flag. The ssh-proxy
subprocess could not match token mode (no --gateway-endpoint) or name
mode (no --name), so it exited immediately — causing a screen flash
and eventual terminal corruption from rapid suspend/resume cycles.

Use --gateway-endpoint for the URL and --gateway for the cluster name,
matching the format already used by start_port_forwards and the CLI.

Fixes #188
johntmyers added a commit that referenced this pull request Mar 10, 2026
)

The ProxyCommand in handle_shell_connect and handle_exec_command was
using --gateway for the URL, but after the #175 rename --gateway means
cluster name and --gateway-endpoint is the URL flag. The ssh-proxy
subprocess could not match token mode (no --gateway-endpoint) or name
mode (no --name), so it exited immediately — causing a screen flash
and eventual terminal corruption from rapid suspend/resume cycles.

Use --gateway-endpoint for the URL and --gateway for the cluster name,
matching the format already used by start_port_forwards and the CLI.

Fixes #188

Co-authored-by: John Myers <johntmyers@users.noreply.github.com>
drew pushed a commit that referenced this pull request Mar 16, 2026
)

The ProxyCommand in handle_shell_connect and handle_exec_command was
using --gateway for the URL, but after the #175 rename --gateway means
cluster name and --gateway-endpoint is the URL flag. The ssh-proxy
subprocess could not match token mode (no --gateway-endpoint) or name
mode (no --name), so it exited immediately — causing a screen flash
and eventual terminal corruption from rapid suspend/resume cycles.

Use --gateway-endpoint for the URL and --gateway for the cluster name,
matching the format already used by start_port_forwards and the CLI.

Fixes #188

Co-authored-by: John Myers <johntmyers@users.noreply.github.com>
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.

Improve sandbox provisioning status messages and UX

1 participant