mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-06 08:24:46 +00:00
fix(daemon): keep lifecycle operations on the selected instance
Restart reconstructed launch inputs and address fallback could redirect a home-selected shutdown to another daemon. Let supervisors publish bound endpoints, retain their worker restart contract, and share captured local lifecycle ownership between CLI and Desktop.
This commit is contained in:
+47
-10
@@ -276,18 +276,55 @@ Detaching is an explicit lifecycle action, not a creation flag. The agent keeps
|
||||
|
||||
## Daemon management
|
||||
|
||||
Define an instance once, then start its saved configuration:
|
||||
|
||||
```bash
|
||||
paseo daemon start # Start the daemon
|
||||
paseo daemon start --web-ui # Start and serve the bundled web UI
|
||||
paseo daemon status # Check status
|
||||
paseo reload # Reload config.json (top-level alias)
|
||||
paseo daemon reload # Reload config.json
|
||||
paseo daemon stop # Stop the daemon
|
||||
paseo daemon config set daemon.listen 127.0.0.1:6799 --home ~/paseo-test
|
||||
paseo daemon config set daemon.relay.enabled false --home ~/paseo-test
|
||||
paseo daemon start --home ~/paseo-test
|
||||
paseo project ls --home ~/paseo-test
|
||||
paseo daemon restart --home ~/paseo-test
|
||||
paseo daemon stop --home ~/paseo-test
|
||||
```
|
||||
|
||||
Reload validates the whole file, applies runtime-safe changes, and reports `appliedPaths`, `restartRequiredPaths`, and `overrideControlledPaths`. Human output prints `paseo daemon restart` only when a changed setting needs it. Use `--json` or `--format yaml` for the structured result. Run `paseo --host <target> reload` to reload a remote daemon's own configuration file. An older host that does not support reload returns an update-host error.
|
||||
`start` runs in the background and reports the actual listening address and supervisor PID. It accepts only home selection and `--timeout <seconds>` (default 600). If waiting times out, the supervisor remains running: use the printed status, log, and stop instructions. A worker that exits before becoming ready makes startup fail.
|
||||
|
||||
Use `PASEO_HOME` to run multiple isolated daemon instances.
|
||||
`restart` requests a replacement worker from the existing supervisor. It rereads the file and retains the supervisor's original environment and arguments. Success confirms a different ready worker, following a changed address for a home target. It never starts a stopped daemon or refreshes the supervisor binary. A timeout reports whether the request was acknowledged; it does not prove why reconnection failed.
|
||||
|
||||
`stop --home` waits for that local supervisor to exit. On POSIX it signals the supervisor without contacting a TCP endpoint. On Windows it uses the ready daemon's shutdown RPC; an unbound instance requires explicit `--force`. `--force` permits forced process-tree cleanup after the graceful timeout (default 15 seconds). `stop --host` only reports **shutdown requested**; remote process exit is not verified. A service manager may start another instance after the captured supervisor exits.
|
||||
|
||||
`status` separates local supervisor state, its published endpoint, the configured address, and RPC reachability. A stopped home is never probed at its configured address. An unbound live supervisor is **not ready**.
|
||||
|
||||
`reload` validates the file, applies runtime-safe changes, and reports `appliedPaths`, `restartRequiredPaths`, and `overrideControlledPaths`. It never implicitly restarts. Use `--json` or `--format yaml` for structured results. An older host lacking the capability reports that it needs an update.
|
||||
|
||||
The root aliases `start`, `status`, `restart`, `reload`, and `pair` use the same commands as `daemon`. Root `run` and `stop` remain agent operations.
|
||||
|
||||
### Foreground deployments and migration
|
||||
|
||||
Use environment overrides with the foreground deployment command:
|
||||
|
||||
```bash
|
||||
PASEO_LISTEN=127.0.0.1:6799 PASEO_RELAY_ENABLED=false paseo daemon run --home ~/paseo-test
|
||||
```
|
||||
|
||||
It stays attached until the supervisor exits or you cancel, without a readiness timeout. Worker restart retains these launch inputs. Stop and relaunch the deployment to change them. If the home already has a live supervisor, `run` returns `already_running` without owning or launching a foreground process.
|
||||
|
||||
Managed `start` ignores inherited daemon-setting overrides, including `PORT`, `PASEO_LISTEN`, relay, voice, and web UI settings. It preserves provider credentials and executable/runtime controls. `start --foreground` is removed; use `daemon run`. Former start/restart configuration flags such as `--port`, `--no-relay`, and `--web-ui` fail before side effects, with the corresponding `config set` migration. See [configuration edits](/docs/configuration#apply-changes).
|
||||
|
||||
### Select one daemon
|
||||
|
||||
Every daemon-connected CLI command accepts global `--home` or `--host`, before or after the command. A home selects a local supervisor's published endpoint; a host selects an explicit endpoint. There is no configured-address or default-port fallback.
|
||||
|
||||
| Selectors | Result |
|
||||
| ------------------------------------------ | ------------------------------------------------------ |
|
||||
| `--home` | That local home, overriding both environment selectors |
|
||||
| `--host` | That endpoint, overriding both environment selectors |
|
||||
| Both flags, or conflicting duplicate flags | `TARGET_AMBIGUOUS` |
|
||||
| Only `PASEO_HOME` or only `PASEO_HOST` | The corresponding target |
|
||||
| Both environment selectors, without a flag | `TARGET_AMBIGUOUS` |
|
||||
| Neither | Default local home, `~/.paseo` |
|
||||
|
||||
Local-only `start`, `daemon run`, `config`, `onboard`, and `set-password` reject explicit `--host` and ignore `PASEO_HOST`. Endpoint operations retain TCP, Unix socket, Windows pipe, SSH, and pairing-offer transports. A host-side CLI controlling a container needs `--host` or `PASEO_HOST`.
|
||||
|
||||
## Hub
|
||||
|
||||
@@ -329,12 +366,12 @@ The global `--host` option accepts either a local target (`host:port`, a unix so
|
||||
Get an offer URL from the daemon you want to control:
|
||||
|
||||
```bash
|
||||
paseo daemon pair # asks before enabling relay, then prints the QR and link
|
||||
paseo daemon pair # prints the QR and link when relay is enabled
|
||||
paseo daemon pair --relay # enables relay without prompting
|
||||
paseo daemon pair --json # structured output; never prompts
|
||||
```
|
||||
|
||||
Relay is off for new installations. In non-interactive or JSON mode, a disabled relay returns a `RELAY_DISABLED` error; pass `--relay` to provide explicit consent. Relay pairing is end-to-end encrypted. See [Security](/docs/security).
|
||||
Relay is off for new installations. A disabled relay returns a `RELAY_DISABLED` error; pass `--relay` to provide explicit consent. For a stopped home, pairing is labelled offline; `--relay` saves relay enablement and the offer includes a start instruction. A live but unreachable home never falls back to an offline identity. Relay pairing is end-to-end encrypted. See [Security](/docs/security).
|
||||
|
||||
Use it from anywhere:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user