Skip to content

fix: reject mixed candidate preflight failures - #165

Merged
steipete merged 2 commits into
openclaw:mainfrom
goutamadwant:fix/candidate-preflight-mixed-failures
Sep 16, 2026
Merged

steipete merged 2 commits into
openclaw:mainfrom
goutamadwant:fix/candidate-preflight-mixed-failures

Conversation

@goutamadwant

@goutamadwant goutamadwant commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Closes #128.

What Problem This Solves

Candidate preflight could report an unsupported check alongside a real validation error, yet OCM would finalize the candidate and switch the environment to it.

User Impact

Mixed, malformed, incomplete, and contradictory failures now stop the upgrade before finalization and binding publication. Candidates whose sole failure is the unsupported check remain compatible, including registry-dependent skipped counts and legacy unsupported command/option diagnostics.

Why This Change Was Made

Require a complete failed JSON result with zero executed checks, a numeric skipped count, and exactly one matching error finding; reject other diagnostics. The text fallback accepts only an unambiguous unsupported command or option plus usage guidance. This retains @goutamadwant's fix and regression coverage, closes the missing-status-field gap found during independent review, and documents the compatibility boundary.

Evidence

On unchanged production code, the new built-CLI regression returned outcome=switched after a candidate reported both unsupported selection and invalid configuration. After the fix it fails before finalization and retains old-local. Unit coverage includes complete sole-unsupported results, registry skipped counts, mixed findings, missing fields, contradictory status, malformed JSON, and appended fatal text. The output contract was checked against OpenClaw's lint formatter.

Behavior proof uses the built OCM CLI and isolated synthetic candidate/service fixtures. No production gateway or credentials were used. Formatting, all-target checking, and the candidate unit matrix pass. After updating two older test stubs to emit the complete upstream JSON shape, 74 of 75 native upgrade cases passed together; the one preparation case returned an empty test-HTTP response and passed in isolation. The isolated Linux full run passed all other test targets and identified those two incomplete stubs before correction. Final exact-head cross-platform CI remains the merge gate.

Rebased on merged #149 at 88d5145; the shared fixture repairs are already on main. The only rebase conflict was the adjacent changelog entry, and both entries are retained. The final patch changes only candidate validation, its tests, usage documentation, and the changelog. Independent review is clean at P0–P2.

All nine cross-platform CI jobs passed on final head c8f59eb9b49d5f8f942ea427f186e4bd51366edd, including full macOS and Linux test suites and installation smoke checks: https://github.com/openclaw/ocm/actions/runs/35054314790.

@clawsweeper

clawsweeper Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 8, 2026
@clawsweeper

clawsweeper Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed September 16, 2026, 12:10 AM ET / 04:10 UTC (Revision 6).

ClawSweeper review

What this changes

Tightens OCM’s upgrade preflight parser to reject mixed or malformed failures, with regression tests and documentation preserving the sole-unsupported compatibility exception.

Merge readiness

⛔ Blocked before merge - 3 items remain

The fix remains necessary: current main and v0.2.47 still accept mixed candidate failures. The earlier skipped-count defect is resolved and no blocking code finding remains, but the supplied evidence still uses synthetic candidates and does not establish real upgrade compatibility.

Priority: P2
Reviewed head: c8f59eb9b49d5f8f942ea427f186e4bd51366edd

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The focused implementation and regression coverage are sound, but fixture-only evidence leaves the real-behavior merge gate unmet.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The captured body reports OCM’s real upgrade entrypoint rejecting mixed output and retaining the previous binding, but both OpenClaw candidates and services are synthetic fixtures. These regressions support correctness without satisfying the outstanding real OpenClaw upgrade and legacy-compatibility proof requirement. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The captured body reports OCM’s real upgrade entrypoint rejecting mixed output and retaining the previous binding, but both OpenClaw candidates and services are synthetic fixtures. These regressions support correctness without satisfying the outstanding real OpenClaw upgrade and legacy-compatibility proof requirement. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 9 items Repository policy and introduced scope: Read the complete root AGENTS.md, contribution guidance, and PR template. No nested tracked AGENTS.md or maintainer-notes directory was found. Origin identifies openclaw/ocm. The pinned merge-base-to-head diff changes four files; the checkout remained clean. Builds and tests were not run during this read-only review.
Current main retains the reported defect: The fetched main classifier accepts any matching unsupported finding or text substring, allowing another genuine error to coexist with the accepted marker.
Latest supplied release remains affected: The v0.2.47 source has the same existential JSON matching and substring fallback. This PR therefore supplies behavior absent from both the inspected main and released implementation.
Findings None None.
Security None None.

How this fits together

OCM runs the candidate OpenClaw runtime’s Doctor check after configuration repair and before finalization. The command’s result determines whether OCM publishes the new runtime binding or follows its existing failure and recovery path.

flowchart TD
 A[Requested runtime upgrade] --> B[Repair target configuration]
 B --> C[Run candidate Doctor]
 C --> D{Successful or solely unsupported?}
 D -->|Yes| E[Finalize candidate]
 E --> F[Publish runtime binding]
 D -->|No| G[Fail upgrade and recover]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The captured body reports OCM’s real upgrade entrypoint rejecting mixed output and retaining the previous binding, but both OpenClaw candidates and services are synthetic fixtures. These regressions support correctness without satisfying the outstanding real OpenClaw upgrade and legacy-compatibility proof requirement. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - Rejecting every stderr line accompanying JSON and narrowly matching legacy text may stop previously accepted upgrades that emit benign warnings or additional help text; actual legacy-runtime output has not established that compatibility.
  • Complete next step (P2) - Add after-fix evidence from an isolated real OpenClaw setup showing rejected-candidate recovery and supported/legacy upgrade compatibility. Terminal screenshots or recordings are preferred when useful; copied output and logs also count. Redact credentials, IP addresses, private endpoints and personal details. Updating the PR body should trigger re-review; otherwise ask a maintainer to comment @clawsweeper re-review.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test growth Production net +44 lines; tests net +99 lines Production growth implements complete-result classification, supported by expanded unit and CLI regression coverage.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #128
Summary: This PR is the explicit implementation candidate for the open mixed-preflight-failure issue.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Verify actual compatibility diagnostics (recommended)
    Supply isolated real OpenClaw upgrade evidence for supported and legacy candidates, narrowly preserving legitimate diagnostics if those runs expose a mismatch.

Technical review

Best possible solution:

Keep complete-result validation at the existing preflight boundary, with upgrade evidence confirming genuine legacy candidates still succeed and rejected candidates preserve recovery behavior.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: a nonzero candidate response containing an unsupported marker plus a genuine error satisfies main’s classifier and returns success. This review did not execute the path.

Is this the best way to solve the issue?

Yes, the existing classifier is the narrowest repair boundary and the patch preserves configuration-repair ordering; historical diagnostic compatibility still needs runtime evidence.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b1557f6aa7df.

Labels

Label justifications:

  • P2: This repairs a bounded upgrade-validation defect without evidence of an active outage.
  • merge-risk: 🚨 compatibility: The stricter stderr and text acceptance rules need real legacy-output evidence to exclude rejecting otherwise compatible candidates.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The captured body reports OCM’s real upgrade entrypoint rejecting mixed output and retaining the previous binding, but both OpenClaw candidates and services are synthetic fixtures. These regressions support correctness without satisfying the outstanding real OpenClaw upgrade and legacy-compatibility proof requirement. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Repository policy and introduced scope: Read the complete root AGENTS.md, contribution guidance, and PR template. No nested tracked AGENTS.md or maintainer-notes directory was found. Origin identifies openclaw/ocm. The pinned merge-base-to-head diff changes four files; the checkout remained clean. Builds and tests were not run during this read-only review. (AGENTS.md:1, c8f59eb9b49d)
  • Current main retains the reported defect: The fetched main classifier accepts any matching unsupported finding or text substring, allowing another genuine error to coexist with the accepted marker. (src/cli/upgrade.rs:5777, b1557f6aa7df)
  • Latest supplied release remains affected: The v0.2.47 source has the same existential JSON matching and substring fallback. This PR therefore supplies behavior absent from both the inspected main and released implementation. (src/cli/upgrade.rs:5777, b7e2802d9ae0)
  • Production owner and dependency boundary: OCM invokes the selected OpenClaw runtime with doctor --lint --only codex/managed-app-server --json. Successful exits bypass classification; failed results enter the changed parser. Configuration repair precedes this check, and failure propagates before finalization. This establishes dependency on OpenClaw’s Doctor output contract, not the Codex harness. (src/cli/upgrade.rs:3783, c8f59eb9b49d)
  • Upstream unsupported-selection contract: The OpenClaw lint runner emits the exact selection-error message, severity and path matched by this patch. Executed checks equal the selected registry entries; skipped checks equal registry size minus selected entries, supporting acceptance of varying nonnegative skipped counts. (src/flows/doctor-lint-flow.ts:29, 8e98d20f4d3e)
  • Upstream JSON envelope: The Doctor formatter emits ok, checksRun, checksSkipped and serialized findings including severity. This supports the new required fields, but current formatter source alone does not establish all historical command-error and stderr behavior. (src/commands/doctor-lint.ts:492, 8e98d20f4d3e)

Likely related people:

  • fuller-stack-dev: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • shakkernerd: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Provide redacted after-fix output demonstrating candidate-failure recovery and successful supported and legacy upgrades in an isolated real OpenClaw setup.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (5 earlier review cycles)
  • reviewed 2026-09-08T03:28:51.606Z sha c4a6cfb :: needs real behavior proof before merge. :: [P1] Preserve registry-dependent skipped-check counts
  • reviewed 2026-09-08T05:42:02.294Z sha 5415191 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-11T07:16:41.915Z sha bbd2417 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-12T02:03:11.578Z sha 2649303 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-13T16:48:22.168Z sha 8c01be1 :: needs real behavior proof before merge. :: none

Require a complete sole-unsupported result before bypassing candidate validation. Reject missing or contradictory status fields, malformed JSON, extra findings and mixed diagnostics. Preserve registry-dependent skipped counts and narrow legacy command/option compatibility; retain the previous binding without finalizing rejected candidates.

Co-authored-by: goutamadwant <workwithgoutam@gmail.com>
@steipete
steipete force-pushed the fix/candidate-preflight-mixed-failures branch from 8c01be1 to 2c5c34b Compare September 16, 2026 04:04
@steipete
steipete merged commit a898020 into openclaw:main Sep 16, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Candidate preflight treats mixed unsupported-check failures as success

2 participants