Skip to content

Add launchd-managed background shares - #5

Merged
icodesign merged 1 commit into
mainfrom
feat/background-share-supervisor
Sep 21, 2026
Merged

icodesign merged 1 commit into
mainfrom
feat/background-share-supervisor

Conversation

@icodesign

Copy link
Copy Markdown
Owner

Problem

An agent-launched remote-installer share could be killed when the temporary command session ended, leaving the install URL visible while the local origin and tunnel were already gone. The existing --timeout only controlled the worker after it had started; it did not give the process a lifetime outside the agent command session.

What changed

  • Added macOS share --background, which registers a native worker with the user's launchd GUI domain and waits for the origin and tunnel to become ready before returning.
  • Added finite-expiry enforcement for managed shares and structured ready output with a share ID.
  • Added status, logs, and stop commands for managed share lifecycle control.
  • Added managed session state, persisted stdout/stderr logs, launchd process-group ownership, and graceful SIGTERM handling.
  • Updated the README, npm package documentation, and agent skill instructions to use the durable background workflow and to avoid temporary command sessions, &, or nohup for links that must survive an agent turn.

Validation

  • cargo fmt -- --check
  • cargo test --all-targets — 158 tests passed (119 library, 18 CLI, 3 Android, 6 availability, 3 download progress, 5 OTA, 4 range-request tests).
  • cargo clippy --all-targets -- -D warnings
  • Real launchd smoke tests: the launcher returned after registration while the native worker and install page remained available; normal expiry shut down the worker and tunnel; SIGKILL of the worker resulted in launchd process-group cleanup of the tunnel child and the session reported failure.

@icodesign
icodesign merged commit abb1019 into main Sep 21, 2026
1 check passed
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.

1 participant