Commit Graph

34 Commits

Author SHA1 Message Date
Peter Steinberger 015913306f fix(nodes): preserve node inventory failures (#126609) 2026-08-20 02:06:09 -07:00
Peter Steinberger 086f5916fa fix(gateway): local devices stall on scope upgrade pending approval despite autoApproveLocal (#124589)
* fix(cli): announce when nodes list degrades to paired-only data

tryReadNodeList swallowed every enrichment failure, so the unfiltered nodes list silently rendered a table without connected/commands state. The fallback is now announced on stderr, keeping --json stdout parseable.

* fix(gateway): silently widen local pairing scopes as documented

`autoApproveLocal` has documented "silently approves pairing, role upgrades,
and scope upgrades from trusted local connections" since the loopback
auto-approval landed, but a later hardening pass forced every scope-upgrade
pairing request non-silent. That block protected nothing locally — silent
initial pairing grants a fresh identity arbitrary requested scopes, so any
local process could mint a new keypair instead of upgrading — while it
stranded every row-authorized client (CLI, native apps, node hosts) on a
manual approval no local surface could perform.

Scope upgrades now ride the same silent-local rule as initial pairing, with
one new restriction that encodes the real boundary: the connect must itself
prove local-grade credentials (auth mode none, or the shared token/password).
Identity-proxy connects (tailscale, trusted-proxy) and bearer device tokens
never did, so their pairing rows remain a durable scope cap, and
`autoApproveLocal: false` still forces manual approval for everything.

The silent self-grant also approves the union of requested plus already-held
scopes: approval merges the existing row back in, so a client requesting only
its missing scope no longer fails the caller-authority check.

The decision surface shrinks with the behavior change: the scope-upgrade veto
contradicted shouldAllowSilentLocalPairing's answer, the CLI-container
locality was a duplicate of the shared-secret-loopback predicate, and three
classifiers re-derived the same shared-secret auth check.

Live-verified on an isolated auth-none loopback gateway: a CLI identity
paired at operator.pairing silently widens to operator.read on the next wider
command, with the scope-upgrade security audit line still emitted.

* test(gateway): rewrite veto-era pairing locks for silent local widening

Five control-ui pairing suite cases and the silent-scope-upgrade poc locked
the removed non-silent veto. The suite cases now assert the new invariant
(local shared-auth upgrades widen silently, malformed and legacy-shaped rows
are repaired by the fresh approval, node-then-operator grants complete
without a stranded prompt), and the poc case now exercises the surviving
manual-approval gate by disabling autoApproveLocal after its watcher
connects, keeping the pairing-request broadcast and remediation-hint
assertions alive on a real remaining path. The voice-node bootstrap failure
was leakage from the aborted sibling tests, and passes again once they
complete their flows.
2026-08-16 07:02:24 -07:00
Peter Steinberger b07c6b2b8b fix(computer-use): macOS live-proof rig deadlocks on operator device approval (#124536)
* fix(computer-use): unblock the macOS live-rig proof flow

The rig ran its operator CLI and its proof runner from one state dir, so both
shared one device identity. A paired operator device is pinned to the scopes of
its first connect, and `nodes list` connects first for `node.pair.list`
(operator.pairing); the proof runner then needs operator.write, which is a scope
upgrade the gateway never approves silently and which no rig client can approve
for itself. The proof runner is a GATEWAY_CLIENT/BACKEND client, so on a
loopback auth-none gateway it is admitted unpaired with the scopes it asks for:
giving the CLI its own `cli-state` identity is enough, and `agent-state` now
never accumulates a pairing row.

`nodes list` also read `node.list` through the plain CLI client while
`nodes status`/`describe` used the diagnostics ladder. On any gateway where the
CLI must pair, the unfiltered list silently dropped connected/commands/
computerUse and `--connected` failed outright, so the documented rig gate could
not confirm the node. Both call sites now use `callNodeDiagnosticsGatewayCli`.

Docs drop the `devices approve <requestId>` instruction, which was circular:
that invocation is its own new device identity.

* test(cli): share the runtime-log formatter across nodes CLI e2e files

The extracted diagnostics-auth file stringified captured log arguments directly, which the type-aware core lint stripe rejects (no-base-to-string). Move the existing formatter into the shared node test helpers instead of duplicating it.
2026-08-16 04:25:03 -07:00
Peter Steinberger ca849506f3 fix(cli): read node liveness from the recorded node.list fact and drop dead nodes-CLI guards (#124348)
Four nodes-CLI repairs at their owners:

- nodes status --last-connected joined a second pairing-scoped RPC
  (node.pair.list) to reconstruct last-connection times the gateway already
  records on every node.list row (lastConnectedAtMs, max of stored pairing
  history and live connection, since 2dcd47d4f4). The client-side join also
  preferred stored history over a live connection instead of taking the max,
  and made the command fail for callers whose auth grants operator.read but
  not operator.pairing. The filter now reads the recorded fact;
  connectedAtMs covers gateways predating it.
- nodes list --connected blanked pending rows and then printed "Pending: 0"
  while requests waited — asserting a fact it never checked. Pending rows
  carry no connection state to filter on; they now always show.
- nodes remove/rename carried unreachable !nodeId guards (resolveCliNodeId
  throws "node required" on blank input and every parse layer drops id-less
  rows) whose dead text pointed at the wrong command (nodes pending targets
  pairing requests, not paired nodes). Guards deleted; the reachable empty
  --name branch now hints at nodes list.
- status.node-mode derived node-service liveness from the formatted
  runtimeShort display string — parsing a fact back out of its own
  projection, dead in all first-party call paths (both callers pass the
  runtime object it is derived from). Field and branch deleted.

e2e test updated to pin the single-RPC shape (asserts node.pair.list is NOT
called); node-mode fixtures now use the production shape.
2026-08-15 19:19:13 -07:00
Peter Steinberger 447393dc32 test(core): remove residual duplicate assertions (#124116) 2026-08-15 02:06:44 -07:00
Peter Steinberger e390781534 refactor: burn cross-directory export name collisions (#121893)
* refactor: name subsystem logger exports

* refactor(test): distinguish exported test doubles

* refactor: consolidate canonical owner helpers

* refactor: give cross-domain helpers distinct names

* chore(lint): ratchet collision debt baselines

* fix(test): complete collision rename consumers

* fix(test): update remaining collision mock consumers

* fix(test): update transcript reader mock export

* refactor: keep embedded logger name at its owner

* fix(test): align embedded logger mock with owner

* refactor: name shared assistant phase extraction

* fix(ui): update assistant phase extractor import

* chore(generated): refresh collision and SDK baselines

* style(test): format merged plugin mocks

* chore(sdk): refresh API content hashes
2026-08-11 06:50:22 -07:00
Peter Steinberger 97505b723c fix(cli): report accurate filtered node totals (#119744) 2026-08-05 14:58:48 -07:00
Peter Steinberger 3856b4fa1b refactor(cli): unify gateway RPC transport (#117601) 2026-08-01 14:06:30 -07:00
WhatsSkiLL db6b23596e fix-cli-preserve-windows-path-delimiters (#114505)
Co-authored-by: IWhatsskill <284122573+IWhatsskill@users.noreply.github.com>
2026-07-28 00:54:42 +08:00
Peter Steinberger 62c5a8b888 fix(gateway): make scope errors machine-readable across clients (#111013)
* fix(gateway): consume structured scope errors

* docs(gateway): clarify tools error boundary

* refactor(gateway): unify node admin policy
2026-07-18 17:53:45 -07:00
mushuiyu886 deb0ffdcdf fix #94040: [Bug]: nodes approve failed: GatewayClientRequestError: unknown requestId (#94452)
* fix(nodes): explain unknown approval request ids

* fix(nodes): keep stale request handling CI-clean

* fix(nodes): point stale approve hint at pending command

* fix(nodes): explain stale approval request ids

* fix(nodes): make stale approval guidance reliable

* fix(nodes): preserve stale approval error context

---------

Co-authored-by: openclaw-clownfish[bot] <280122609+openclaw-clownfish[bot]@users.noreply.github.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-06-27 00:40:29 +01:00
Vincent Koc 0a3e0d081d test: remove no-op mock registrars 2026-06-19 22:55:38 +08:00
Jason (Json) 65b460f234 fix(nodes): surface pending reapproval diagnostics (#92547)
* fix(nodes): surface pending reapproval diagnostics

* fix(nodes): harden reapproval diagnostics

* fix(nodes): scope pending diagnostics

* fix(nodes): request pairing diagnostics in cli

* fix(nodes): reuse stored auth for diagnostics

* fix(nodes): preserve selected diagnostics credentials

* fix(nodes): prefer approved diagnostics auth

* fix(nodes): narrow diagnostics fallbacks

* fix(nodes): recover from stale diagnostics auth

* fix(gateway): preserve connect error narrowing

* fix(nodes): isolate privileged diagnostics auth

* fix(nodes): constrain privileged diagnostics auth

* fix(nodes): close diagnostics review gaps

* fix(nodes): guard reapproval cleanup races

* fix(nodes): defer stale pairing cleanup

* fix(nodes): preserve reapproval on hello failure

* test(nodes): await post-handshake reapproval cleanup

* test(nodes): avoid unbound websocket send capture

* fix(nodes): allow local auth-none diagnostics

* fix(nodes): preserve overlapping reapproval

* fix(nodes): preserve pending node metadata

* fix(nodes): keep connection age with status

* fix(nodes): preserve reapproval during reconnect races

* fix(nodes): serialize reapproval cleanup

* fix(nodes): bound reapproval reconnect races

* test(nodes): satisfy cleanup claim lint

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-06-13 17:40:18 -07:00
Peter Steinberger 8cb093e7a9 docs: document cli test batch 2026-06-04 19:32:43 -04:00
Peter Steinberger 0ec29289c6 fix: tighten CLI utility failure handling (#86918)
* fix: tighten cli utility failure handling

* fix: preserve completion install error cause

* fix: keep update completion refresh best effort
2026-05-26 18:08:44 +01:00
Josh Avant e1c1c57242 Fix node approval scope requests (#84392)
* fix(cli): request node approval scopes

* docs(changelog): note node approval scope fix
2026-05-19 21:47:10 -05:00
Peter Steinberger 91bae4baa5 test: dedupe nodes cli mock reads 2026-05-13 03:23:24 +01:00
Peter Steinberger a978f0fe36 test: guard nodes basic mock calls 2026-05-12 07:59:24 +01:00
Peter Steinberger 4cb2c1006c test: clear nodes basic broad matchers 2026-05-10 17:15:51 +01:00
Peter Steinberger 330ba1fa31 refactor: move canvas to plugin surfaces 2026-05-07 09:07:18 +01:00
Peter Steinberger 7fb2a356e8 fix(nodes): allow removing stale paired nodes 2026-04-27 13:20:52 +01:00
Vincent Koc a50edbdc60 fix(cli): keep nodes list aligned with nodes status (#72619)
* fix(cli): keep nodes list aligned with nodes status

* fix(clownfish): address review for ghcrawl-156588-autonomous-smoke (1)

* fix(cli): keep nodes list aligned with nodes status
2026-04-27 02:39:33 -07:00
Peter Steinberger 23e50859eb test(e2e): align release harness coverage 2026-04-12 16:08:12 +01:00
Peter Steinberger 3f1d6fe147 test: speed up cli and command suites 2026-03-31 02:25:02 +01:00
Peter Steinberger abf2157b18 fix: sync agent and autoreply e2e updates 2026-03-23 01:33:40 -07:00
Peter Steinberger a13586619b test: move integration-heavy suites to e2e lane 2026-03-02 05:33:07 +00:00
Peter Steinberger 7fdf54f078 test: move cli local suites out of e2e 2026-02-22 11:30:29 +00:00
Peter Steinberger d6ad647f56 test(cli): share nodes ios fixture helpers 2026-02-22 07:44:56 +00:00
Peter Steinberger a1cb700a05 test: dedupe and optimize test suites 2026-02-19 15:19:38 +00:00
Peter Steinberger 3af9f704c8 test(cli): dedupe repeated gateway node and slack pairing setup 2026-02-18 13:34:03 +00:00
cpojer 048e29ea35 chore: Fix types in tests 45/N. 2026-02-17 15:50:07 +09:00
Charlie Greenman dec6859702 agents: reduce prompt token bloat from exec and context (#16539)
Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 8e1635fa3f
Co-authored-by: CharlieGreenman <8540141+CharlieGreenman@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-02-14 18:32:45 -05:00
Peter Steinberger af784b9a8c refactor(test): share cli program e2e mocks 2026-02-14 20:09:27 +00:00
Peter Steinberger 9131b22a28 test: migrate suites to e2e coverage layout 2026-02-13 14:28:22 +00:00