Repository navigation
fix(status): make online JSON status responsive on large fleets - #150269
Conversation
Use the narrow Gateway connection reader and consume the Gateway's status projection before local fleet discovery. Preserve read scope, expose prepared roster/configuration facts additively, and identify local inspections that were not collected. Keep the existing offline diagnostics path. Related: #149538 Gateway-side sibling: #150223
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 16, 2026, 4:28 PM ET / 20:28 UTC (Revision 2). ClawSweeper reviewWhat this changesMakes online JSON status reuse Gateway fleet information and identify skipped local inspections, while retaining offline diagnostics. Merge readiness⛔ Blocked before merge - 4 items remain The performance fix remains useful and the latest test repair preserves the existing assertions. No discrete blocking code defect was found; the deliberate JSON compatibility change still needs an explicit upgrade disposition. Priority: P2 Review scores
Verification
How this fits togetherThe status CLI combines local installation information with Gateway health and fleet data. This change uses the running Gateway’s summary before attempting expensive local discovery. flowchart TD
A[JSON status command] --> B[Read connection configuration]
B --> C[Request Gateway summary]
C --> D{Gateway available?}
D -->|Yes| E[Use fleet projection]
D -->|No| F[Collect local diagnostics]
E --> G[JSON with collection metadata]
F --> G
Decision needed
Why: The body intentionally documents reduced collection, but its compatibility disposition addresses the additive RPC parameter rather than acceptance of the changed CLI output contract. Before merge
Agent review detailsSecurityNone. PR surfaceSource +331, Tests +280, Docs +18. Total +629 across 22 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep Gateway-owned online collection with an explicitly accepted JSON upgrade contract and clear access to the omitted local diagnostics. Do we have a high-confidence way to reproduce the issue? Yes, source inspection establishes that current main performs local fleet collection before JSON assembly, and the supplied fleet traces identify those expensive stages. This read-only review did not execute a reproduction. Is this the best way to solve the issue? Yes for the performance mechanism: reuse the Gateway’s prepared facts through the existing status owner. Acceptance of the reduced JSON contract remains a separate upgrade decision. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against dd303462323e. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
…claw#150269) * fix(status): make online JSON status responsive on large fleets Use the narrow Gateway connection reader and consume the Gateway's status projection before local fleet discovery. Preserve read scope, expose prepared roster/configuration facts additively, and identify local inspections that were not collected. Keep the existing offline diagnostics path. Related: openclaw#149538 Gateway-side sibling: openclaw#150223 * test(gateway): align status scope expectations with projection default
Related: #149538. Gateway-side sibling: #150223.
What Problem This Solves
Fixes
openclaw status --jsonspending tens of seconds rescanning a large fleet even when the Gateway's status handler is responsive. The campaign context is the 632-agent × 54-model fleet reported in #149538 by @609NFT.User Impact
Online JSON status uses Gateway-owned session, admission, heartbeat, task, and runtime facts. Agent names and ownership, memory-plugin selection, and the local Gateway's configured update channel come from an additive, opt-in status projection. The request retains
operator.read; sensitive session details stay redacted. Local workspace/bootstrap checks and requested local plugin inspections are explicitly marked not collected, including nullable bootstrap counts andcollected: falseaudit/compatibility sections. Explicit usage credential selection is preserved. Remote Gateway configuration cannot select the local CLI installation's update channel.Offline diagnostics retain their existing path. Follow-up: offline scan is unbounded; bounding it needs a cleanup contract for exec SecretRefs.
Why This Change Was Made
The CLI's full config reader prepared plugin metadata for every workspace, local admission ran before report assembly, and most of the Gateway response was discarded before a second local summary was built. The online path now uses the existing narrow Gateway dispatch reader and consumes the prepared response. The original discovery branch remains only for offline diagnostics. Memory-slot policy moved to one shared owner rather than being copied into the new projection.
Compatibility disposition
includeCliProjectionis an internal status-RPC request detail used by the built-in JSON client and forwarded as a summary-handler argument. It is an additive RPC parameter, with no dedicated operator CLI flag, configuration key, or environment variable. The handler enables it only for literaltrue; omitted, false, and other values keep the default closed. The independentoperator.admincheck still controls sensitive fields, so a read-scoped projection remains redacted.Evidence
Synthetic fixture: 200 separate workspaces and agent databases, 54 configured model references per agent (10,800 total), 53 inline provider definitions, the same 12-plugin allowlist as the sibling proof, and a loopback-only model endpoint. No model turns were launched. Both runs used isolated state; Node v26.8.2.
Before samples are deadline observations: terminating their
pnpmwrapper left underlying children running, so they could overlap and are not clean completion timings. JSON appeared later. After samples usenode openclaw.mjs status --jsondirectly, following one successful authorized status RPC, and await each process without terminating it. No precise speedup factor is claimed. An initial sample taken immediately after the readiness log hit a Gateway RPC timeout, used the unchanged offline path, and completed in 45.730 s; the next two online samples completed in 2.845 s and 1.367 s. That startup-unavailable case remains a limitation of the retained offline fallback.Before traces recorded 200 metadata scans per config read (14.580–20.181 s) and 14.611–25.844 s of local admission; the corresponding Gateway status handlers took 341–462 ms. All three confirmed-online traces contain zero plugin metadata scans and zero local admission/session-summary stages, and return all 200 agents with explicit ownership.
node scripts/check-changed.mjs: passed, including core/test typechecks, lint, and repository guards.pnpm build: passed in 6m 35.3s with the topology guard intact.pnpm check:import-cycles: 0 runtime value cycles.pnpm docs:listcompleted; status docs updated.--mode branch --base origin/main --max-priority P1: scoped-clean, no actionable P0/P1 findings.The earlier build failure was
Boundary configuration or resolution topology changed during compilation: the regression file was added during the SDK declaration phase, changing both the source inventory and TypeScript roots. No production import caused that failure, and the guard was retained. The final build passed with source/test files frozen.Initial cutover production: +395/−64 LOC; tests/support: +289/−4 LOC; docs: +18/−0 LOC. The growth is the online adapter, explicit collection metadata, and additive projection; the required offline implementation remains intact.
Status-handler CI repair
The previous-head CI job reported three stale exact-argument expectations: the read-scope and admin-scope cases plus the channel-summary-skipping case. They now include
includeCliProjection: false, retaining the exact scope, sensitive-field, channel-summary, and response assertions. A repository-widegetStatusSummary/handler assertion audit found no other stale expectations. Reusing the existing request helper removes duplicated setup and satisfies the oversized-file line-growth ratchet without weakening coverage.Relative to
b0286e53ff37eee4acf163ef59b1f0e9c0c412a5, this repair changes onlysrc/gateway/server-methods/server-methods.test.ts: +10/−15 test LOC, 0 production LOC. The complete test file passes 219/219 tests. The original production/build/runtime evidence above remains applicable because production is unchanged.Repair validation:
node scripts/check-changed.mjs --base b0286e53ff37eee4acf163ef59b1f0e9c0c412a5 -- src/gateway/server-methods/server-methods.test.tsexited 0, including core/test typechecks, targeted core lint, formatting, line-growth and other repository guards. No extension lint substitute was needed.git diff --checkis clean.