Repository navigation
fix(doctor): report unusable cloud worker profiles - #124995
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
8c30cf1 to
65627a8
Compare
|
Codex review: needs changes before merge. Reviewed August 17, 2026, 9:51 PM ET / August 18, 2026, 01:51 UTC. ClawSweeper reviewWhat this changesAdds a Crabbox-owned Doctor health check that reports configured cloud-worker profiles whose Crabbox binary is missing, non-executable, or too old before dispatch. Merge readinessKeep open: the prior P1 remains on the rebased head. Doctor registers the Crabbox check for disabled, denied, or excluded plugins, so lint can fail for a provider the Gateway will not activate. Priority: P2 Review scores
Verification
How this fits togetherDoctor reads configured cloud-worker profiles, discovers their bundled provider owner, and registers that owner’s health check. The Crabbox check then resolves the configured binary, probes its version, and emits lint/JSON findings for operators. flowchart TD
A[Cloud worker profiles] --> B[Bundled provider manifest]
B --> C[Plugin activation policy]
C --> D[Doctor health registration]
D --> E[Crabbox binary and version check]
E --> F[Doctor lint and JSON findings]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +232, Tests +286. Total +518 across 9 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Filter bundled worker-provider Doctor owners through the shared manifest-owner base policy, cover every disabled-policy mode, and retain the plugin-owned binary detector. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: configure a missing Crabbox binary together with any disabled-policy state, then run the targeted Doctor lint check; registration currently bypasses the policy gate and the warning exits nonzero. Is this the best way to solve the issue? No: the plugin-owned detector is the right owner, but its core registration must reuse the shared activation policy before this is the best fix. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b5b17c654b2d. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What 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 (4 earlier review cycles)
|
65627a8 to
6029b7d
Compare
6029b7d to
3c4e96c
Compare
3c4e96c to
d581993
Compare
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where operators could configure a Crabbox cloud worker profile with a missing binary, pass
openclaw config validate, and receive no relevantopenclaw doctorfinding until a later session dispatch failed.Before this change, an isolated profile with
settings.binary: "/nonexistent/path/to/crabbox"produced:Gateway startup also reached
readywithout a profile-readiness warning.environments.listadvertised theawsprofile, whileenvironments.statusrejectedawsas an unknown environment ID because that method reports concrete environments, not profile health. The Cloud Worker Desktop path uses the same advertised profile inventory and had the same gap.Follow-up observed but intentionally not folded into this repair: the minimal reproduction omits Crabbox
ttlandidleTimeout, so the machine-options subcall logs a provider-shape error whileenvironments.liststill advertises the profile. A separate semantic-profile doctor check can surface that broader provider-settings class without widening this binary-readiness fix.Why This Change Was Made
Crabbox owns the readiness policy. A narrow
doctor-health-apiartifact contributes a plugin health check, while core only discovers configured bundled worker-provider owners from manifest metadata and invokes their optional health registrar. No Crabbox identifier or rule is hardcoded into core doctor.The default check is conservative and local:
--versionprobe per binary with a 2-second timeout and 64 KiB output cap;Deliberately excluded:
config validateremains a shape check, so a binary that will appear later is still valid and the two surfaces do not duplicate one another;inspectis not called because it performs fresh EC2 control-plane reads; doctor makes no cloud-provider API calls;Codex remote-exec status was also checked directly in
openai/codexatbe6e8eac029b183056b7e4402879f15d2c85f61b(codex-rs/exec-server/src/environment.rs:100): it observes an already-configured exec-server connection without starting or reconnecting one, so it is not a reusable pre-dispatch Crabbox profile probe.User Impact
Operators who run
openclaw doctor --lintoropenclaw doctor --jsonnow get a profile-specific warning and exact repair command before dispatch when the Crabbox binary is missing, non-executable, or definitively too old. Healthy profiles and installations without cloud workers remain silent for this check.Evidence
Built CLI, isolated state directories, free non-default ports,
OPENCLAW_SKIP_CHANNELS=1, and Discord/Twilio credential variables unset for every run:The post-rebase stdout/stderr captures were inspected separately. Config validation and human-text stderr were empty. Each JSON run also emitted one unrelated current-main
memory-coreowner-authorization diagnostic on stderr; JSON integrity and the Crabbox finding state were unaffected.Validation:
Production LOC: +237/-5 (net +232) | Tests: +287/-1. The production growth is the new generic manifest-owner discovery boundary plus the plugin-owned readiness detector and bounded subprocess contract; no parallel runtime, config, or dispatch path was added.
Rebased over worker node-transport convergence
Rebased onto
0e7f3209f2dand force-pushed exact headd581993bfab. The conflict preserved current main's node-enrollment provider and tests while keeping the shared provider ID needed by doctor.identityRefId,CRABBOX_KEY_REF_PROVIDER, and Crabbox'sresolveSshIdentityremain deleted. They are dead rather than renamed: Crabbox now advertisesworker-turn, returns{ node: { deviceId } }, and core launches turns throughnode-worker-tunnel.ts. The generic SSH tunnel is workspace-only after #125465; no key-reference replacement exists for Crabbox.The rebuilt three-state proof again shows no Crabbox finding for no-profile and real-binary configs, and exactly one actionable warning for
/nonexistent/path/to/crabboxin both human text and JSON.pnpm buildemitsdist/extensions/crabbox/doctor-health-api.json the rebased head. Focused tests, the complete local changed gate, and autoreview are clean. The prior unrelated Codex fixture and ratchet notes were removed because their fixes are now upstream and absent from this branch diff.