fix: clarify daemon status probe target
This commit is contained in:
@@ -424,12 +424,12 @@ Subcommands:
|
||||
- `daemon restart`
|
||||
|
||||
Notes:
|
||||
- `daemon status` uses the same URL/token defaults as `gateway status` unless you pass `--url/--token/--password`.
|
||||
- `daemon status` probes the Gateway RPC by default using the daemon’s resolved port/config (override with `--url/--token/--password`).
|
||||
- `daemon status` supports `--no-probe`, `--deep`, and `--json` for scripting.
|
||||
- `daemon status` also surfaces legacy or extra gateway services when it can detect them (`--deep` adds system-level scans).
|
||||
- `daemon status` prints which config path the CLI uses vs which config the daemon likely uses (service env), plus the resolved probe target URL.
|
||||
- `daemon install` defaults to Node runtime; use `--runtime bun` only when WhatsApp is disabled.
|
||||
- `daemon install` options: `--port`, `--runtime`, `--token`.
|
||||
- `daemon install` options: `--port`, `--runtime`, `--token`, `--force`.
|
||||
|
||||
### `logs`
|
||||
Tail Gateway file logs via RPC.
|
||||
|
||||
@@ -170,13 +170,14 @@ clawdbot logs --follow
|
||||
```
|
||||
|
||||
Notes:
|
||||
- `daemon status` probes the Gateway RPC by default (same URL/token defaults as `gateway status`).
|
||||
- `daemon status` probes the Gateway RPC by default using the daemon’s resolved port/config (override with `--url`).
|
||||
- `daemon status --deep` adds system-level scans (LaunchDaemons/system units).
|
||||
- `daemon status` reports **supervisor runtime** (launchd/systemd running) separately from **RPC reachability** (WS connect + status RPC).
|
||||
- `daemon status` prints config path + probe target to avoid “localhost vs LAN bind” confusion and profile mismatches.
|
||||
- `logs` tails the Gateway file log via RPC (no manual `tail`/`grep` needed).
|
||||
- If other gateway-like services are detected, the CLI warns. We recommend **one gateway per machine**; one gateway can host multiple agents.
|
||||
- Cleanup: `clawdbot daemon uninstall` (current service) and `clawdbot doctor` (legacy migrations).
|
||||
- `daemon install` is a no-op when already installed; use `clawdbot daemon install --force` to reinstall (profile/env/path changes).
|
||||
|
||||
Bundled mac app:
|
||||
- Clawdbot.app can bundle a bun-compiled gateway binary and install a per-user LaunchAgent labeled `com.clawdbot.gateway`.
|
||||
|
||||
@@ -207,6 +207,7 @@ async function probeGatewayStatus(opts: {
|
||||
password?: string;
|
||||
timeoutMs: number;
|
||||
json?: boolean;
|
||||
configPath?: string;
|
||||
}) {
|
||||
try {
|
||||
await withProgress(
|
||||
@@ -224,6 +225,7 @@ async function probeGatewayStatus(opts: {
|
||||
timeoutMs: opts.timeoutMs,
|
||||
clientName: "cli",
|
||||
mode: "cli",
|
||||
...(opts.configPath ? { configPath: opts.configPath } : {}),
|
||||
}),
|
||||
);
|
||||
return { ok: true } as const;
|
||||
@@ -447,6 +449,7 @@ async function gatherDaemonStatus(opts: {
|
||||
daemonCfg.gateway?.auth?.password,
|
||||
timeoutMs,
|
||||
json: opts.rpc.json,
|
||||
configPath: daemonConfigSummary.path,
|
||||
})
|
||||
: undefined;
|
||||
let lastError: string | undefined;
|
||||
|
||||
@@ -25,6 +25,11 @@ export type CallGatewayOptions = {
|
||||
instanceId?: string;
|
||||
minProtocol?: number;
|
||||
maxProtocol?: number;
|
||||
/**
|
||||
* Overrides the config path shown in connection error details.
|
||||
* Does not affect config loading; callers still control auth via opts.token/password/env/config.
|
||||
*/
|
||||
configPath?: string;
|
||||
};
|
||||
|
||||
export type GatewayConnectionDetails = {
|
||||
@@ -36,13 +41,12 @@ export type GatewayConnectionDetails = {
|
||||
};
|
||||
|
||||
export function buildGatewayConnectionDetails(
|
||||
options: { config?: ClawdbotConfig; url?: string } = {},
|
||||
options: { config?: ClawdbotConfig; url?: string; configPath?: string } = {},
|
||||
): GatewayConnectionDetails {
|
||||
const config = options.config ?? loadConfig();
|
||||
const configPath = resolveConfigPath(
|
||||
process.env,
|
||||
resolveStateDir(process.env),
|
||||
);
|
||||
const configPath =
|
||||
options.configPath ??
|
||||
resolveConfigPath(process.env, resolveStateDir(process.env));
|
||||
const isRemoteMode = config.gateway?.mode === "remote";
|
||||
const remote = isRemoteMode ? config.gateway?.remote : undefined;
|
||||
const localPort = resolveGatewayPort(config);
|
||||
@@ -107,6 +111,7 @@ export async function callGateway<T = unknown>(
|
||||
const connectionDetails = buildGatewayConnectionDetails({
|
||||
config,
|
||||
url: opts.url,
|
||||
...(opts.configPath ? { configPath: opts.configPath } : {}),
|
||||
});
|
||||
const url = connectionDetails.url;
|
||||
const token =
|
||||
|
||||
Reference in New Issue
Block a user