Skip to content

fix(instances): fix selection loop and require Tailscale for connect - #249

Merged
mfauzaan merged 1 commit into
mainfrom
fix/instances-connect-preview-loop
Oct 6, 2026
Merged

mfauzaan merged 1 commit into
mainfrom
fix/instances-connect-preview-loop

Conversation

@mfauzaan

@mfauzaan mfauzaan commented Oct 6, 2026

Copy link
Copy Markdown
Member

Summary

Fix: instance picker loops forever when there are no main pods

wukong application instances connect built the picker list with a Main: and a Preview: header, then used fixed index math to skip headers:

if instance_name_idx == 0 || instance_name_idx == main_pods.len() + 1 { continue; }

When an application has only preview-labelled pods (e.g. mv-platform Prod / Green), main_pods.len() + 1 == 1, so the only real pod was also treated as a header and the prompt re-appeared on every selection. If it had exited, preview_pods[idx - main_pods.len() - 2] would have underflowed.

Each picker item is now paired with its pod (None for headers), so selection no longer depends on index math. The cursor also defaults to the first selectable pod instead of the header.

Feature: Tailscale confirmation

The Livebook URL is only reachable over Tailscale. Without it, the connectivity test spins for ~100s and then tears the instance down.

  • Ask the user to confirm they are on Tailscale before provisioning the Livebook instance. Answering "No" exits without creating any resources.
  • Mention Tailscale in the connectivity test spinner and in the failure message.

Test plan

  • cargo fmt, cargo clippy (no new warnings)
  • Local --features prod build against mv-platform Prod / Green (preview-only pods): picker selects the pod, no loop
  • Answer "No" to the Tailscale prompt → exits without provisioning
  • Answer "Yes" while on Tailscale → Livebook connects

🤖 Generated with Claude Code

The instance picker used fixed index math that assumed a "Main:" section
was always present. When an application only had preview-labelled pods,
every item was treated as a section header and the prompt looped forever.
Map each item to its pod (or None for headers) instead, and default the
cursor to the first selectable pod.

The Livebook URL is only reachable over Tailscale, so confirm the user is
connected before provisioning, and mention Tailscale in the connectivity
test and failure messages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@zacaaron zacaaron left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖

@mfauzaan
mfauzaan merged commit 09263a4 into main Oct 6, 2026
6 checks passed
@mfauzaan
mfauzaan deleted the fix/instances-connect-preview-loop branch October 6, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants