* fix(daemon): inspect registered Gateway services accurately Read strict Windows service commands from registered actions and preserve supported launcher encodings without treating dynamic CMD expansion as a verified command. Retain exact task identity and bound systemd selection. Use one platform inventory collector for the existing full and diagnostic projections. Report incomplete inspection through Doctor while preserving status JSON and the existing managed-service filters. Keep load-state inspection behind a leaf capability instead of reverse facade imports. Refs #151608, #151463. * fix(daemon): classify service commands by position Share runtime and root-option parsing so Node display names and profile values cannot classify a Node service as a Gateway. Preserve literal shell, env and generated launchd wrappers, and honor the executable selected by launchd. Read systemd's single-quoted arguments through the existing parser and preserve literal apostrophes when rendering. Keep strict Windows command rejection separate from lenient diagnostics, and align the native-boundary fixtures with that contract without weakening ownership or source-preservation assertions. * fix(daemon): inspect direct registered task actions Read literal executable actions from their registered Scheduled Task and revalidate the action before returning command facts. Strict runtime inspection uses the same registered command instead of a default launcher. Keep executable paths out of managed launcher provenance. Direct actions remain outside automatic update service management when no restorable CMD/VBS launcher exists, preserving the prior stop and definition ownership boundary. * test(windows): prove installed service upgrade paths Extend the existing native Scheduled Task proof with verified immutable package handoff and fixed fresh, published 2026.9.3, and published 2026.9.4 CLI cells. Require live version/build identity, selected PID replacement, peer continuity, strict registered-action inspection, and settled cleanup before evidence publication and disposable installation retirement. Keep source-only and repair modes, permissions, deadlines, and native lifecycle owners intact. Direct executable fixtures remain disabled and preserve the updater's unsupported-mutation boundary. Native execution remains pending. * test(doctor): retain managed Windows launcher provenance Keep the generated CMD path on the existing managed-service fixture before and after reinstall so Doctor admission sees the installation it models. Preserve all stop, install, restart, rollback, and direct-action refusal expectations without changing production behavior. * test(windows): exercise native autostart ownership boundaries Extend the existing published-updater cell with its stopped, task-owned Scheduled Task. Capture real admission, exercise native enable/disable, and preserve the definition and files after foreign-owner refusal. Test retained admission separately from restoration so legitimate same-root refresh remains supported. Restore the original XML through the existing fixture lifetime; do not broaden product control or workflow permissions. Modeled owner tests, selected source checks, and independent review pass. Actual Windows execution remains required before a native proof claim. * test(windows): retain sanitized installed command failures Keep unexpected command stdout and stderr in bounded failure diagnostics so JSON-mode CLI errors survive native proof failures. Reuse the existing terminal and support redaction owners before clipping; withhold incomplete captures while preserving the existing truncation failure. Move the existing command runner into its own test-support module and update both consumers without changing timeout, exit, signal, or cleanup semantics. Real-child regressions reproduce both privacy defects and pass with the correction. The original installed Gateway failure remains undiagnosed. * fix(daemon): preserve Windows probe budgets and Doctor cleanup eligibility Use the existing cold PowerShell startup budget for Task Scheduler queries without an explicit deadline. Keep periodic activation checks bounded and preserve unknown results rather than treating timeouts as task absence. The native probe test now exercises the production default. Share Doctor's existing legacy cleanup classification with its registered preview. Keep unsupported platforms, scopes and unrecognized Linux unit names as findings without advertising removal or invoking unrelated cleanup. Extract the classifier and complete cleanup test group without dropping assertions or changing native mutation ownership. Retain the failed installed Windows runs and their source identities; new package and native upgrade qualification remain separate requirements. * chore(daemon): retire stale Doctor size baseline The split Doctor service module no longer needs a max-lines suppression. Remove only its stale baseline entry so the shrink-only ratchet matches actual source. Product, dependency, workflow and fixture bytes are unchanged. * test(windows): retain sanitized service proof observations Record bounded install and status facts before semantic assertions so a successful CLI exit cannot hide the native inspection reason. Exclude free-form stderr and private response fields, and preserve existing execution, deadline, and cleanup assertions. * fix(windows): preserve native status inspection defaults Keep the CLI RPC default distinct from an explicit timeout so Windows service inspection can use its existing cold-start budget. Forward explicit load-query deadlines through the Task Scheduler owner while preserving lifecycle defaults and timeout diagnostics. * fix(models): retain discovered models after refresh failures Record successful legacy catalog results at the producer boundary so unavailable refreshes retain the accepted inventory. Preserve explicit outcomes, advisory SDK fallback behavior, and first-discovery starter policy. * fix(models): preserve skipped catalog outcome semantics Mark bundled static, configured, and advisory catalog projections with explicit empty outcomes so legacy success inference cannot promote them to observed account inventory. Preserve live outcomes and helper types. Keep exact auth provenance histories and move existing fixture/policy code into focused owners where required by the line-cap ratchet. Validation: 447 producer and sibling cases, 56 shared self-hosted cases, 95 auth/policy cases, causal missing-outcome failures, maintained checks, and independent review. * test(plugin-sdk): keep discovery loader types acyclic Move the shared loader type into a leaf consumed by both discovery contract helpers. Preserve its public provider-test-contracts export without a child-to-parent type import cycle. Validation: maintained Madge check reports zero cycles; core, all core test graphs, extension test types, lint, formatting and independent review pass. Runtime behavior and previous catalog proof are unchanged. * fix(plugin-sdk): mark generated static catalogs explicitly Keep the generated non-live, non-strict catalog adapter from claiming successful acquisition for manifest or configured rows. Preserve null, errors, strict and custom callbacks, static catalogs, and public types. Validation: three existing controls fail before the correction; all49 owner and sibling cases pass afterward, with types, lint, line caps and fresh independent review clean. * test(windows): handle omitted scheduled task settings * test(windows): preserve native context and failure evidence * test(daemon): wait for installed gateway readiness before inspection * test(daemon): stop installed fixtures through their profiled CLI * fix(daemon): inspect extra Windows services before removal Keep verified Node and legacy diagnostics visible while offering read-only Scheduled Task inspection in Doctor and deep status. Preserve the existing service cleanup owners and diagnostic JSON shape. Carry the canonical SQLite fixture host-context and dependency-selection repairs from #158209 and #158409 for the inherited CI collection failure. * fix: restore asynchronous harness task completion Complete the shared task-content projection cutover for asynchronous finalization and delivery. Preserve the captured Incognito policy and exact task-assignment fences. The unchanged worker suite reproduced six ReferenceError failures before the fix and passes all seven cases afterward; the sibling SDK runtime suite passes all 30 cases. Independent review is clean through P2. * test(windows): budget installed service phases and retain progress * test(windows): retain failed installed update progress Read failed published-updater progress through the existing asynchronous SQLite owner before native cleanup. Retain only safe phase, status and step timings; preserve all command, body and teardown deadlines. Validation: five installed-fixture tests, services types, targeted changed checks and independent review through P2 passed. Shared diagnostic implementation qualified in the Windows fixture owner. * fix(daemon): bound aggregate Windows service inventory Carry one monotonic deadline through Scheduler discovery, launcher reads, registration revalidation, and missing-launcher metadata. Preserve completed findings and report incomplete inventory when the shared budget is exhausted. * fix(daemon): classify registered helpers without profile admission Let read-only registered inventory classify faithfully revalidated commands without requiring an OpenClaw profile. Keep selected-service profile admission strict and preserve launcher, Task, script and deadline checks. Native disabled-discovery exposed a false warning for a static node --version helper. The actual collector regression fails before this fix and passes with all 206 owner and sibling cases afterward. * fix(daemon): recognize released waiting task launchers Recognize the exact waiting VBS wrapper shipped by 2026.9.3 during owned service reconciliation. Keep custom launcher behavior unknown and preserve all command, root, Task and authority checks. The real audit entry point rejected this released form as TaskLauncher unknown-edit before repair. The causal regression and edited-launcher control pass with 55 audit and 140 backup/rewrite sibling cases. * test(daemon): cover retained Task ownership refusal * test(windows): preserve XML bytes around enabled export lines
24 KiB
summary, read_when, title, sidebarTitle
| summary | read_when | title | sidebarTitle | |||
|---|---|---|---|---|---|---|
| Query a running Gateway: health, usage-cost, stability, diagnostics export, status, probe, call, suspend, and resume |
|
Query a running Gateway | Query |
The WebSocket RPC query subcommands and their shared options. Part of the openclaw gateway reference.
Query a running Gateway
All query commands use WebSocket RPC.
With token, password, or none authentication, ordinary RPC calls to the
configured local loopback Gateway do not open the shared state database for device
authentication. Explicit URL targets and paired remote connections retain their
device authentication rules.
WebSocket opening-handshake timeouts report a Gateway transport error with
ETIMEDOUT, including the target and a status-check hint. JSON error output uses
error.type: "gateway_transport_error", as for other connection failures.
gateway health
openclaw gateway health --url ws://127.0.0.1:18789
openclaw gateway health --port 18789
/healthz is a liveness probe: it returns as soon as the server can answer HTTP. /readyz is stricter and stays red while startup plugin sidecars, channels, or configured hooks are still settling. Local or authenticated detailed /readyz responses include an eventLoop diagnostic block (delay, utilization, CPU-core ratio, degraded flag).
gateway usage-cost
Fetch usage-cost summaries from session logs.
openclaw gateway usage-cost
openclaw gateway usage-cost --days 7
openclaw gateway usage-cost --agent work --json
openclaw gateway usage-cost --all-agents
openclaw gateway usage-cost --json
Human-readable output warns that totals may be incomplete when the usage cache is
refreshing, partial, or stale. The command returns the available snapshot from
one request; run it again later to check for refreshed totals. JSON output preserves
the cacheStatus object so scripts can inspect the same state.
gateway stability
Fetch the recent diagnostic stability recorder from a running Gateway.
openclaw gateway stability
openclaw gateway stability --type payload.large
openclaw gateway stability --bundle latest
openclaw gateway stability --bundle latest --export
openclaw gateway stability --json
gateway diagnostics export
Write a local diagnostics zip designed for bug reports. For the privacy model and bundle contents, see Diagnostics Export.
openclaw gateway diagnostics export
openclaw gateway diagnostics export --output openclaw-diagnostics.zip
openclaw gateway diagnostics export --json
The export bundles: manifest.json (file inventory), summary.md (Markdown summary), diagnostics.json (top-level config/logs/discovery/stability/status/health summary), config/sanitized.json, status/gateway-status.json, health/gateway-health.json, logs/openclaw-sanitized.jsonl, and stability/latest.json when a bundle exists.
It is designed to be shared. It keeps operational details useful for debugging — safe log fields, subsystem names, status codes, durations, configured modes, ports, plugin/provider ids, non-secret feature settings, and redacted operational log messages — and omits or redacts chat text, webhook bodies, tool outputs, credentials, cookies, account/message identifiers, prompt/instruction text, hostnames, and secret values. When a log message looks like user/chat/tool payload text (e.g. "user said", "chat text", "tool output", "webhook body"), the export keeps only the fact that a message was omitted plus its byte count.
gateway status
Shows the Gateway service (launchd/systemd/schtasks) plus an optional connectivity/auth probe.
openclaw gateway status
openclaw gateway status --json
openclaw gateway status --require-rpc
openclaw gateway status --port 19001
gateway probe
The "debug everything" command. It always probes:
- your configured remote gateway (if set), and
- localhost (loopback), even if remote is configured.
Passing --url adds that explicit target ahead of both. Human output labels targets URL (explicit), Remote (configured) / Remote (configured, inactive), and Local loopback.
openclaw gateway probe
openclaw gateway probe --json
openclaw gateway probe --port 18789
- `ok`: at least one target is reachable.
- `degraded`: at least one target accepted a connection but did not complete full detail RPC diagnostics.
- `capability`: best capability seen across reachable targets (`read_only`, `write_capable`, `admin_capable`, `pairing_pending`, `connected_no_operator_scope`, or `unknown`).
- `primaryTargetId`: best target to treat as the active winner, in order: explicit URL, SSH tunnel, configured remote, local loopback.
- `warnings[]`: best-effort warning records with `code`, `message`, optional `targetIds`.
- `network`: local loopback/tailnet URL hints derived from current config and host networking.
- `discovery.timeoutMs` / `discovery.count`: the actual discovery budget/result count used for this probe pass.
Per target (`targets[].connect`): `ok` (reachability + degraded classification), `rpcOk` (full detail RPC success), `scopeLimited` (detail RPC failed on missing operator scope).
Per target (`targets[].auth`): `role` and `scopes` reported in `hello-ok` when available, plus the surfaced `capability` classification.
Remote over SSH (Mac app parity)
The macOS app "Remote over SSH" mode uses a local port-forward so a loopback-only remote gateway becomes reachable at ws://127.0.0.1:<port>.
CLI equivalent:
openclaw gateway probe --ssh user@gateway-host
OpenClaw launches only an SSH client found in OS-managed system directories. On native Windows,
install the OpenSSH Client optional feature; Windows places it under
%SystemRoot%\System32\OpenSSH.
Config defaults (optional): gateway.remote.sshTarget, gateway.remote.sshIdentity.
gateway call <method>
Low-level RPC helper.
Use --expect-url <url> to bind a call to a previously observed Gateway endpoint
without changing URL selection or authentication. The CLI compares the exact
resolved URL before connecting and fails if the destination changed. Automation
can obtain the endpoint from gateway.url in openclaw status --json; a redacted
URL cannot serve as an exact endpoint assertion.
openclaw gateway call status
openclaw gateway call health --port 18999
openclaw gateway call logs.tail --params '{"limit": 200}'
To add an existing checkout to the Control UI's Place picker, use the project registration and listing examples.
For sessions.send and chat.send, JSON timeoutMs is the receiving agent's
execution budget, not an acknowledgment timeout. Omit it for ordinary
coordination; --timeout independently limits how long this CLI waits:
openclaw gateway call sessions.send --params '{"key":"<session-key>","message":"Status update"}' --timeout 10000
A started response confirms acceptance, not a completed reply. These CLI methods
are for operators and external automation. Agents use their exposed
sessions_send tool,
never a shell or direct RPC substitute. An unavailable messaging tool is not
permission to use the CLI. Subagents return results through their accepted task
completion path; the parent relays any necessary coordination with other sessions.
In an agent's exec subprocess (OPENCLAW_SHELL=exec), message RPCs are
refused before connecting so worker reports cannot appear as fresh human input.
Ordinary operator terminals and non-message Gateway diagnostics are unchanged.
openclaw.setup.detect uses a 40-second default so the Gateway can finish its
bounded AI-access scan. An explicit --timeout still takes precedence.
gateway suspend
Prepare an idle Gateway for a cooperative host freeze or snapshot. Without
--wait, active work returns a nonzero exit with blocker details. With
--wait, the CLI retries until the bounded deadline using one stable request
ID. The value must be a non-negative number of seconds; an empty value is rejected.
Use --wait 0 for a single attempt without polling.
openclaw gateway suspend
openclaw gateway suspend --request-id snapshot-2026-08-11 --wait 30
openclaw gateway suspend --port 18999 --json
The ready output includes the suspension ID, lease expiry, and the matching
resume command. Common RPC options such as --url, --token, --password,
--timeout, --json, and --port are supported.
gateway resume <suspensionId>
Release a prepared suspension after thaw or when the host operation is abandoned.
openclaw gateway resume <suspensionId>
openclaw gateway resume <suspensionId> --port 18999 --json
An already expired or resumed lease is a successful no-op. A different active
suspension ID is rejected. Once shutdown commits, resume is refused even for the
original owner; gateway.suspend.status reports that owner's shutdown progress
until server teardown closes RPC access.