Repository navigation
Conversation
…vice A pre-lock owner is only detected through server-runtime.json, which pre-lock servers overwrite on start and delete on shutdown. A pre-lock boot service that no longer owns that record is invisible, so a lock-aware desktop or CLI server starts next to it on the same T3 home. Before claiming ownership, check the boot service installed for this home. If it is loaded or will load at login, and its runtime fails the existing __service-preflight ownership probe, refuse with exit 78 and ask the user to run `t3 update` or `t3 service uninstall`. A booted-out and disabled service does not block. Probe failures never block startup.
Author
|
Superseded by #15. |
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.
Follow-up to pingdotgg#16102.
A pre-lock owner is only detected through
server-runtime.json. Pre-lock servers overwrite that record on start and delete it on shutdown, so a pre-lock background service that no longer owns the record is invisible, and a lock-aware desktop or CLI server starts next to it on the same T3 home. The usual way to get there is a service installed once withnpx t3, which nothing updates afterwards, plus the desktop app on the same~/.t3.Before claiming ownership,
acquireServerOwnershipnow looks at the boot service installed for the same home (canonical path from the unit'sT3CODE_HOME). It refuses with exit 78 when the service is loaded or will load at login, and its runtime fails the launcher's existing__service-preflightownership probe. The message asks the user to runt3 updateort3 service uninstall. The fixed exit-78 dialogs in the desktop and WSL backends name the same two commands.The unit constants and
T3CODE_HOMEparser move tocloud/bootServiceConfig.tsbecausebootService.tsalready importsserverOwnership.ts. The preflight arguments and result check move toservicePreflight.tsso the launcher and this check share them.Verification
vp test run apps/server/src/serverOwnership.test.ts apps/server/src/cloud/bootService.test.ts apps/server/src/serviceLauncher.test.ts: 79 passed. The new tests use real temporary homes and the real SQLite lock, with fakes only at the process boundary. They cover both macOS 13+ (=> disabled) and macOS 12 (=> true)launchctl print-disabledoutput.launchctl: withHOMEpointed at a temporary directory whose plist serves a temporary T3 home withactiveVersion0.0.42, and the realcom.t3tools.t3code.servicebooted out and disabled, the server starts.{"status":"ready","version":"0.0.42","launcherProtocol":2}(noownershipProtocol), so it is treated as pre-lock.service-state.jsonand__service-preflightboth first shipped in 0.0.32, so every runtime this check reads answers the probe rather than falling through to starting a server.Not verified: the refusal path against a real loaded launchd job or a real systemd unit (it would replace the machine's real service), and the desktop dialog. Services installed by 0.0.29 to 0.0.31 have no
service-state.jsonand are not detected. A pre-lock server started by hand after a lock-aware one is still undetectable.Implemented with gpt-6.1-sol through Codex and Claude Opus 5.5 in T3 Code.