Repository navigation
fix(host): restart Ace Helper by itself when Tailscale starts or changes tailnet - #665
Merged
Merged
Conversation
…ges tailnet Why: apps/host/src/gateway.ts#function serve | Ace Helper's tailnet self-restart exits non-zero because launchd's KeepAlive relaunches only a failed exit Why: apps/host/src/tailnet.ts#function watch | Tailscale stopping must not restart the host; only a running tailnet other than the one the host started on does
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ace Helper reads the owner's login, the channels' tailnet and its tailnet listeners once, at startup. If Tailscale started later, or switched to another tailnet, the Helper stayed off it until someone pressed Restart.
tailscale statusevery 10 seconds. When Tailscale runs on a tailnet other than the one the host started on for two checks in a row, Ace Helper shuts down cleanly and exits with status 75.KeepAlive { SuccessfulExit = false }starts the Helper again, so it serves on the new tailnet. This is the same restart as Settings' Restart button: workers close without aborting and resume, and open terminals close.catalog.tailnetand the tailnet listeners are module-level values read at startup, and changing them live would mean reconnecting every client as a new participant.ace servehas no supervisor, so it printsTailscale is on <tailnet> now. Restart ace serve to use it.instead.Ace Helper is restarting to use Tailscale. Try again in a moment.Map: ^6, ^101. Part of #539: the Helper restarts itself rather than picking up the tailnet in-process, so whether that closes the issue is left to the issue.
Smoke: this lane's host served with
config.helper = trueon its ownACE_HOME, with--loopbackbecause a fake address can't be bound. A loop stood in for launchd's relaunch-on-failure, and a stubtailscaleon PATH returnedstatus --jsonfrom a file. The stub was needed because switching this Mac's real Tailscale would cut off other work on it.ace newfailed with "Start Tailscale first". After the state switched to Running onfake-w2.ts.net, the Helper exited 75 within 20 s and the loop restarted it.ace newthen created a channel, andace lslisted it.fake-w2.ts.net, switching Tailscale to Stopped did not restart it over 25 s.ace serveprinted the restart line after a switch to another tailnet and kept running.Built in Ace
No: made from Claude Code (a fix-train worker), using the CLI for the smoke test. Dogfooding gap tracked in #5.