Skip to content

Fix upgrade migration, config validation, and CLI timeouts - #482

Merged
TeoSlayer merged 2 commits into
mainfrom
fix/open-issues-20260924
Sep 24, 2026
Merged

TeoSlayer merged 2 commits into
mainfrom
fix/open-issues-20260924

Conversation

@TeoSlayer

@TeoSlayer TeoSlayer commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Legacy macOS upgrades can leave the old daemon loaded and schedule a duplicate at login. Config writes accept invalid values, and send-message callers cannot bound connection/handshake time. This change migrates launchd labels, validates config writes, honors configured encryption, and adds a total --timeout budget.

  • Migrate loaded and unloaded legacy launchd plists, retain operator settings, deduplicate reloads, and abort if bootout fails.
  • Initialize a missing auto-update control file on upgrades, preserve explicit opt-out, and stop claiming that starting the updater means automatic updates are enabled.
  • Reject unknown config keys and invalid boolean/address/path values, store typed values, retain proxy redaction and clearable proxy/transport settings.
  • Reject unknown send-message flags and invalid durations. --timeout covers lookup, handshake, dial, ACK and reply; --wait retains its documented reply-only behavior. Timeout errors note that delivery may already have occurred.
  • Accept help/--version, use stdout and success exit for requested help, return consistent empty app lists, and suppress the obsolete restart-error detail once the running daemon matches the installed version. Preserve the updater's historical record to avoid racing its writer.

Fixes #475. Fixes #476. Fixes #477. Fixes #480. Addresses the CLI portions of #481.

The launchd log claim in #481 is already addressed by #464: daemon log rotation discovers redirected stdout/stderr and defaults to a 50 MB cap. A 5.3 MB log is below that cap. Empty app lists already exited zero; this PR also makes their output consistent. The repeated macOS resource-limit warning is fixed separately in app-store. #479's first-contact changes remain in existing PR #474; its focused regression tests pass and are not duplicated here.

Validation: new issue regression tests (including stalled lookup, handshake, dial, ACK and reply); full cmd, daemon and logcap suites; GOWORK=off go test -parallel 4 -count=1 ./tests/ (passed, 351 s); GOWORK=off go build ./...; go vet; installer shell syntax; all commit hooks with GOWORK=off. Tests use isolated homes and fake launchctl, not the host's services.

Merge dependency: canonical installer PR pilot-protocol/release#50 must land first; both scripts are byte-identical. The core installer-parity check remains correctly failing until then. The PR-event architecture run and Linux/macOS tests pass; an earlier push-event run on the same commit hit the existing daemon-help subprocess timing failure. App-store warning fix: pilot-protocol/app-store#41.

…ed probe

The probe ran pilot-daemon -help once; ETXTBSY (binary still open for
writing: an updater swapping it, or a concurrently forked process holding
the write fd) made it report the daemon's flags as unknown, and the empty
result was cached. Seen as TestDaemonFlagUsageParsesUsage failing in CI
under parallel tests. Retry up to 5x with 50 ms spacing within the probe
timeout, and only cache successful probes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@TeoSlayer
TeoSlayer marked this pull request as ready for review September 24, 2026 18:20
@TeoSlayer
TeoSlayer merged commit eeb7f83 into main Sep 24, 2026
18 checks passed
@TeoSlayer
TeoSlayer deleted the fix/open-issues-20260924 branch September 24, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment