Skip to content

fix(tailscale): just run tailscale up synchronously - #114

Merged
joelteply merged 1 commit into
canaryfrom
fix/tailscale-prompt-just-run-up
Apr 26, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/tailscale-prompt-just-run-up

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Drops the GUI-app-foregrounding intermediate step. Just runs tailscale up — its URL prints straight into the user's terminal, they cmd-click, browser auth completes, the up command returns. Identical bash + PS leaf shape. No bg jobs / log-tailing / URL extraction.

PR #112 used `open -a Tailscale` on Mac to surface the sign-in flow,
which brings up the GUI app's "Login Required" window with an extra
"Log In..." click before the actual auth URL appears. Joel: "I think
it could be simpler and more powershell friendly to do differently."

Pattern continuum already uses: just run `tailscale up`. The CLI prints
the auth URL straight to the user's terminal — where they're already
looking — and blocks until they authorize via the URL. Modern macOS
Terminal auto-links HTTPS URLs (cmd-click). Linux/Windows terminals
the same. No GUI middleman, no extra click.

Implementation:
- Bash tailscale_login_check_or_prompt and PS Test-TailscaleLoginOrPrompt
  drop the `open -a Tailscale` / "open browser to URL" code path.
- They run `tailscale up` synchronously, with `|| true` (bash) /
  try-catch (PS) so if the user cancels (Ctrl-C), airc continues.
- airc proceeds to host/join with whatever address set is currently
  reachable (same-machine and same-LAN paths still work even if user
  abandons Tailscale auth).
- Identical shape across both leaves. No bg jobs, no log-tailing, no
  URL extraction, no platform-specific browser launchers.

Verified locally with mock tailscale: prompt fires, mock-`tailscale up`
prints the URL, airc continues. Real mac+real Tailscale e2e was
verified by the prior fix #113; this just trims the surface.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings April 26, 2026 15:58
@joelteply
joelteply merged commit 3f812af into canary Apr 26, 2026
@joelteply
joelteply deleted the fix/tailscale-prompt-just-run-up branch April 26, 2026 15:58

Copilot AI 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.

Pull request overview

Simplifies the Tailscale “logged out” handling by removing the GUI-foregrounding / multi-step flow and instead running tailscale up synchronously so the auth URL is emitted directly to the user.

Changes:

  • Bash: replace OS-specific “open Tailscale.app / print instructions” with a synchronous tailscale up call (non-fatal on cancel).
  • PowerShell: mirror the same behavior by invoking tailscale up synchronously when status indicates Logged out / NeedsLogin.
  • Update user-facing messaging to point to airc join --no-tailscale as the opt-out.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
airc.ps1 When Tailscale is logged out, print guidance and run tailscale up synchronously to let the auth URL flow to the terminal.
airc Same behavior as PowerShell: on “logged out”, run tailscale up synchronously and continue if it exits non-zero.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

joelteply added a commit that referenced this pull request Aug 1, 2026
…tity (task #114) (#1311)

The room_roster suite (room_roster_cards + siblings) was flaky under
full-suite parallelism. Root cause: every Machine::boot()+join fell
through to the LIVE mesh-identity resolver — host state shared by every
parallel test:

  - `gh api user` shell-out (network + gh auth, 3s kill-deadline that
    BLOCKS the runtime thread inside `join`),
  - `git config user.email` fallback,
  - on total probe failure, the REAL ~/.airc/machine-id,
  - and a provisional (non-gh) result re-probes gh on EVERY later
    resolve.

Reproduced: with a hostile-host shim (hanging gh + failing git — what a
loaded suite run degrades to), the pre-fix binary pinned at ~3.3s (the
gh deadline inside join) and intermittently FAILED
peer_name_survives_identity_card_scrolling_past_the_recent_window
(2 of the first 5 shim runs). Post-fix the same shim runs green in
0.11s — no shell-outs left on the path.

Fix follows the repo's established pattern (daemon_lan_visibility's
pin_identity, Operator-source cache — trusted as-is, never expired,
never re-resolved):

  - hoist `pin_identity` into tests/common/mod.rs (one copy; the
    daemon_lan_visibility duplicate is removed),
  - add `Machine::pin_identity` — pins the shared coordinator store
    BEFORE any scope attaches,
  - each room_roster test pins a UNIQUE Operator identity, so RoomId
    derivation never touches host state and never collides across
    tests.

No assertion weakened; no #[ignore]. Proof: cargo test -p airc-lib
twice at default parallelism, both fully green (336 lib + all
integration binaries, 0 failures).


Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

Co-authored-by: Claude Fable 5 <[email protected]>
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.

2 participants