Repository navigation
feat: add readiness conditions and providers - #104018
giodl73-repo wants to merge 6 commits into
Conversation
|
Codex review: blocked before merge. Reviewed October 2, 2026, 2:03 AM ET / 06:03 UTC (Revision 53). ClawSweeper reviewWhat this changesAdds operator-selected Gateway readiness conditions, bounded plugin observations, and subject identities shared by HTTP probes and ready, health, and status RPC responses. Merge readiness⛔ Blocked before merge - 6 items remain This remains useful, distinct work that current main does not implement. The previous admission-refresh and SDK-documentation findings are resolved, but a callback-custody defect remains alongside unresolved public SDK acceptance and packaged compatibility evidence. Priority: P2 Review scores
Verification
How this fits togetherGateway readiness tells deployment hosts whether OpenClaw can serve work. This change combines Gateway lifecycle facts with selected workspace and plugin observations, then publishes one structured readiness result. flowchart TD
A[Operator readiness selection] --> D[Canonical readiness evaluator]
B[Gateway lifecycle facts] --> D
C[Workspace and plugin observations] --> D
D --> E[Required conditions satisfied]
E --> F[HTTP readiness response]
E --> G[Ready health and status RPC results]
Decision needed
Why: The PR explicitly requests this commitment; source correctness and runtime proof cannot determine the permanent SDK scope. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +2061, Tests +2670, Docs +66, Generated 0, Other +2. Total +4799 across 66 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one opt-in evaluator, preserve legacy deployment behavior, and separate callback admission revocation from physical custody until pending work settles. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the custody trigger: hold an abort-ignoring readiness callback, then quiesce and dispose its plugin instance; abort removes the call token before raw settlement. This review did not execute that scenario. Is this the best way to solve the issue? Unclear pending SDK acceptance. The canonical opt-in design is coherent, but cancellation must revoke admission without falsely reporting physical callback completion. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 19fdc737079c. LabelsLabel changes:
Label 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 (52 earlier review cycles; latest 8 shown)
|
|
Packaged Docker Crabbox proof is complete on exact head
The lane passed local, container ready/fail-closed, reverse-proxy ready/fail-closed, node-mode not-ready/ready, and workspace full/recovery scenarios. The run used the trusted-main |
153d413 to
61b6346
Compare
61b6346 to
b9a6f19
Compare
|
@clawsweeper re-review |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Refreshed onto current The 26-commit feature series was preserved and reconciled with current HTTP probe, Gateway kernel/request-context, plugin replacement, SDK documentation, and subject-identity ownership. The refreshed head also addresses the two source-backed P1 findings:
Focused exact-head proof:
Broader Windows-only noise remains outside this patch: existing The public Plugin SDK/config scope remains the explicit maintainer decision; this refresh does not infer that acceptance. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Prepared a bounded repair for the pending-callback quarantine P1 in the existing review: 76871e01ad77d2c6e178fd94897f6b38481c3ad5, based directly on this PR head Latest test-only follow-up: 8d98a2229ff48372131ecb595ed040687aa3f1bf. Frozen proof caught and fixed test typing errors and a shard-capacity issue: the HTTP regression now lives at Plugin-loader follow-up: 136182bb36887a68e6c22826888f14424fecb7b6. A new regression in the production loader test graph loads two real Full admission-path follow-up: f177e69a2c02ec27b09a76286db10f4c176ea232. A test-only lifecycle regression starts an actual Gateway and synthetic bundled plugin, holds an abort-ignoring readiness callback, sends a real WebSocket The separate fork branch Code/test evidence:
Final command: Frozen follow-up:
Limitations: the initial evidence above used reused dependencies; the frozen reruns supersede that installation gap. The real plugin-loader replacement and full watcher/config-writer/transaction/RPC/plugin-reload paths are now proved. Full-check disposition and resolved current-main stack integration remain outstanding. Current main |
|
Exact-head code and test evidence for Current-main integration:
Blacksmith Testbox static evidence:
Blacksmith Testbox exact-head runtime evidence:
No Lobster change, patch retirement, SDK/config acceptance, packaged-upgrade compatibility, or merge decision is claimed by this evidence. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Pausing this implementation as part of an author-approved reduction of the active review queue. The readiness/profile implementation stack (#104018, #113421, #113422, #114636, #121355) is being parked together; RFC discussions openclaw/rfcs#33 and openclaw/rfcs#37 remain open and unchanged. Reopen the relevant implementation slices when maintainers agree the applicable public readiness/profile scope and there is capacity to refresh exact-head conformance proof. This is a prioritization pause, not a claim that the proposal was rejected or superseded. Branch and commit history are retained. |
Related RFC: openclaw/rfcs#33
Maintainer Decision Requested
Should V1 include the public, activation-scoped
api.registerReadinessCriterionPlugin SDK contract together with operator selection throughgateway.readiness?The proposed answer is yes: plugins already own runtime resources that core cannot observe correctly, registration does not select or require a criterion, callbacks are observational and bounded by core, and invalid or stalled providers become structured
Unknownresults instead of stalling/readyz. Approving this means treating the callback and selection identifiers as supported compatibility surface.If maintainers do not want that public commitment in V1, the separable fallback is to land the canonical core evaluator and core-owned conditions first, then defer plugin registration. Subject identity remains useful in either shape.
Problem
OpenClaw exposes Gateway
/readyand/readyz, but readiness is a fixed set of Gateway observations. Hosts cannot select the additional facts their deployment requires, plugins cannot contribute bounded observations, and CLI, health, and status do not share one canonical structured result. Operators therefore reconstruct "ready to serve" with private scripts.Proposal
Implement RFC 0018 as an opt-in readiness contract:
gateway.readinessis absentFalseorUnknownconditionsgateway.readiness/ready,/readyz, Gatewayready, Gateway health/status projections, andopenclaw ready --json; keep HTTP/healthand/healthzas shallow livenessSubject Identity
A readiness decision can cover a Gateway, active config, plugin set, workspace, nodes, and plugin-owned resources at once. Canonical results declare those subjects once and each condition references the object it describes. Across polls,
(subjectRef, type)is the stable condition key: a changed condition on the same Gateway ID is a state transition, while a changed Gateway ID is replacement.IDs renew with the lifecycle owned by each subject. OpenClaw generates process and Gateway IDs. A host may provide
OPENCLAW_INSTANCE_IDonly as a fingerprinted host-workload parent, never as the Gateway ID. Config reload and drain do not rotate the Gateway ID; disposal and restart do. OpenClaw retains no history, but Docker, Kubernetes, OCC, telemetry, or another host can store and diff these bounded results.Plugins receive a namespaced subject collector rather than inventing global references. Core reconciles declarations and fails closed on unresolved references, namespace conflicts, parent cycles, excess subjects, or duplicate
(subjectRef, type)pairs. This is readiness attribution, not a general resource store, tenant identity, or control-plane model.The focused subject-identity contract is included in RFC 0018's
Readiness Subjects v1sidecar.Upgrade Compatibility
Absence of
gateway.readinessis the compatibility boundary:/readyand/readyzcall only the legacy checker, so runtime or plugin evaluator failure cannot introduce a new503. Presence of the section, including{}, opts into bounded canonical evaluation./healthzremains shallow liveness.This PR does not add Hosting Profiles, Lobster/OCC concepts, Policy or Doctor dependencies, or a second health service.
Implementation Stack
The complete upstream landing stack is:
RFC 0018 - Readiness Conditions
a8098928a6b. It is restacked on upstream/main9ef94e4ef93.a53f16878cc. It depends on PR 104018 and has been restacked after this parent baseline fix.RFC 0023 - Standard Hosting Profiles
18c42a7f26a. It depends on PRs 104018 and 113421.123bae7b876. It depends on PR 113422.This PR is step 1. It includes tests, protocol bounds, Plugin SDK types, operator documentation, and Gateway RPC wiring so HTTP,
ready, health, status, and CLI consumers share the same evaluator. RFC 0018 is independently adoptable; steps 3 and 4 are optional RFC 0023 follow-ons.Real behavior proof
Behavior or issue addressed:
Gateway readiness now has one canonical opt-in result shared by
/ready,/readyz, Gateway RPCready, health/status projections, andopenclaw ready --json, while preserving legacy readiness whengateway.readinessis absent.Real environment tested:
Ubuntu 24.04 WSL checkout
/tmp/openclaw-pr104018-merge2, Nodev24.15.0, pnpm11.15.1, fork branchgiodl73-repo/openclaw:enterpriseclaw/pr104018-readiness-restackat commita8098928a6b4276a78e3b29c6db76f5aeaef2f9f.Exact steps or command run after this patch:
git fetch origin enterpriseclaw/pr104018-readiness-restack && git checkout -B pr104018-current FETCH_HEAD && git reset --hard FETCH_HEADnode scripts/run-vitest.mjs run src/gateway/server/readiness.test.ts src/gateway/server-methods/health.readiness.test.ts src/gateway/server-methods-list.test.ts src/commands/status-runtime-shared.test.ts src/commands/ready.test.ts packages/gateway-protocol/src/schema/snapshot.test.ts src/gateway/server-startup-plugin-quarantine.test.ts --reporter=verbose --maxWorkers=1PROTOCOL_SINCE_BASE_SHA=b7f9cd0a01671f7be5fc34b4bd4bf6770603f480 pnpm protocol:checknode scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.src.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/test-src-pr104018-restack.tsbuildinfopnpm deadcode:exportspnpm plugin-sdk:api:checkpnpm exec oxfmt --check apps/android/app/src/main/java/ai/openclaw/app/gateway/GatewayProtocol.kt packages/gateway-protocol/src/schema/snapshot.test.ts scripts/plugin-sdk-surface-report.mjs src/commands/health.ts src/commands/status-runtime-shared.test.ts src/commands/status-runtime-shared.ts src/commands/status-all/format.ts src/gateway/health/types.ts src/gateway/methods/core-descriptors.ts src/gateway/server-methods-list.test.ts src/gateway/server-methods.ts src/gateway/server-methods/health.ts src/gateway/server-methods/health.readiness.test.ts src/gateway/server-startup-plugin-quarantine.test.ts src/gateway/server/readiness.test.ts src/commands/ready.test.tsgit diff --checkEvidence after fix:
Local WSL terminal output at commit
90c2c3530ebreported:test] passed 3 Vitest shards in 29.24s;pnpm protocol:checkreportedprotocol since guard passed: 5 new core methods use train 2026.7and exited 0; TypeScript exited 0;deadcode:exportsreported all three Knip unused-export scans passed with 0 entries;oxfmt --checkreportedAll matched files use the correct format;git diff --checkexited 0. After the baseline fix at commita8098928a6b,pnpm plugin-sdk:api:checkreportedOK docs/.generated/plugin-sdk-api-baseline.sha256, andgit diff --checkexited 0.Observed result after fix:
Focused readiness, Gateway method, Gateway method-list, status, ready-command, protocol-schema, and startup-quarantine coverage passed together after the upstream/main restack; generated protocol outputs are current, including the Android Gateway method tail; the updated type surface accepts gateway probe health payloads; no dead exports, formatting drift, or whitespace errors remain.
What was not tested:
This proof did not run a packaged Docker readiness/hosting profile matrix on this parent PR. The previously linked dependent profile-stack package proof remains supporting evidence for the downstream stack, not a replacement for this PR's source-level gate.
Validation
90c2c3530eb:src/gateway/server/readiness.test.ts,src/gateway/server-methods/health.readiness.test.ts,src/gateway/server-methods-list.test.ts,src/commands/status-runtime-shared.test.ts,src/commands/ready.test.ts,packages/gateway-protocol/src/schema/snapshot.test.ts, andsrc/gateway/server-startup-plugin-quarantine.test.ts.PROTOCOL_SINCE_BASE_SHA=b7f9cd0a01671f7be5fc34b4bd4bf6770603f480 pnpm protocol:checkpassed in WSL and verified generated protocol artifacts.node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.src.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/test-src-pr104018-restack.tsbuildinfopassed in WSL.pnpm deadcode:exportspassed in WSL with 0 unused-export entries.pnpm plugin-sdk:api:checkpassed in WSL at exact heada8098928a6bafter refreshing the intendedmodule/plugin-entrySDK baseline hash.pnpm exec oxfmt --checkpassed for the touched readiness/status/gateway/protocol files.git diff --checkpassed.