Skip to content

fix(raft): report missing CLI in channel status - #123140

Merged
steipete merged 1 commit into
mainfrom
fix/raft-probe-outcome
Aug 13, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/raft-probe-outcome

Conversation

@steipete

@steipete steipete commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Closes #123137

What Problem This Solves

Fixes an issue where Raft operators using the documented openclaw channels status --probe verification path would not receive a standard success or failure outcome when OpenClaw checked for the raft CLI. A missing binary could leave the account looking configured without the expected probe failed status or actionable account error.

Why This Change Was Made

The Raft plugin now records its existing binary-detection fact as a coherent canonical probe outcome while preserving the shipped cliFound detail. The change stays plugin-local: shared status/Gateway consumers already understand { ok, error }, and the discriminated result prevents contradictory success, CLI-presence, and error states.

User Impact

Raft status checks now report works when the CLI is available and probe failed with Raft CLI not found on the Gateway PATH when it is missing. JSON and capability output continue to expose cliFound and the existing Raft CLI: found/missing detail.

Evidence

Production delta: +13/-6, net +7. Tests: +51/-1, net +50.

AI-assisted: yes. The implementation and regression were reviewed against the complete plugin/status owner path.

@clawsweeper

clawsweeper Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 13, 2026 10:55
@steipete steipete self-assigned this Aug 13, 2026
@openclaw-barnacle openclaw-barnacle Bot added channel: raft Channel integration: Raft size: S maintainer Maintainer-authored PR labels Aug 13, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 13, 2026
@clawsweeper

clawsweeper Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 13, 2026, 7:17 AM ET / 11:17 UTC.

ClawSweeper review

What this changes

The PR changes Raft CLI detection from a diagnostic-only probe to a typed success-or-failure result and adds focused regression coverage.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep this maintainer PR open: it correctly adds ok and error to the Raft probe, but the new failure text still does not reach the account error or warnings promised by the PR body.

Priority: P2
Reviewed head: 7e6914fce23710c841270079a0bd0ab65571942d
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The localized producer repair is well-scoped, but it does not yet deliver the advertised operator-visible error.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a maintainer-authored PR; the external-contributor real-behavior-proof gate does not apply.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a maintainer-authored PR; the external-contributor real-behavior-proof gate does not apply.
Evidence reviewed 6 items Current producer omits the canonical outcome: Current main returns only cliFound from the Raft probe, so generic status consumers have no ok or error field to classify.
Shared renderer consumes probe.ok: The terminal status renderer emits works or probe failed only when the account probe supplies a boolean ok.
Proposed error is not projected into warnings: Account snapshots retain runtime lastError, while issue collection considers runtime state and plugin-owned collectors; neither path maps a generic { ok: false, error } probe into an account error or warning.
Findings 1 actionable finding [P1] Project the failed probe into an actionable status issue
Security None None.

How this fits together

The Raft plugin probes for its local CLI before the shared Gateway status collector builds account snapshots. Those snapshots drive the channels status --probe terminal output, JSON, and operator warnings.

flowchart LR
  A[Raft CLI on Gateway PATH] --> B[Raft plugin probe]
  B --> C{CLI found?}
  C -->|yes| D[Successful probe]
  C -->|no| E[Failure with error text]
  D --> F[Gateway account snapshot]
  E --> F
  F --> G[Channel status output]
  F --> H[Operator warnings]
Loading

Decision needed

Question Recommendation
Should missing Raft CLI be exposed through a Raft-owned status issue, or should generic failed probes populate shared account lastError state? Emit a Raft-owned status issue: Keep the shared status contract unchanged and have the Raft plugin turn its failed probe into the actionable warning required by its documented verification flow.

Why: The proposed producer repair is correct, but current shared projection does not consume generic probe errors; choosing a shared contract versus a plugin-local status issue affects other channel plugins.

Before merge

  • Project the failed probe into an actionable status issue (P1) - The new error remains only inside probe. Account snapshots and status-issue collection do not map generic failed probes into lastError or warnings, so channels status --probe gains probe failed but still omits the promised actionable missing-CLI error. Add a Raft-owned projection or an approved shared mapping, plus an end-to-end status regression.
  • Resolve merge risk (P1) - Production code grows by seven net lines for a bug fix; retain that growth only if it is completed into the operator-visible Raft failure path rather than leaving a richer unused probe shape.

Findings

  • [P1] Project the failed probe into an actionable status issue — extensions/raft/src/channel.ts:64-72
Agent review details

Security

None.

PR surface

Source +7, Tests +50. Total +57 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 13 6 +7
Tests 1 51 1 +50
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 64 7 +57

Review metrics

Metric Value Why it matters
Production vs test LOC production +13/-6 (net +7); tests +51/-1 (net +50) The compact discriminated probe result is localized, but the positive bug-fix growth must complete the end-to-end status behavior.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #123137
Summary: This PR is the candidate repair for the Raft status-probe defect, though its consumer-facing failure projection remains incomplete.

Members:

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

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the typed Raft probe local, then project its missing-CLI failure into the canonical operator-visible status warning or an explicitly approved shared mapping, with a regression that renders the failed status path.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the typed Raft probe local, then project its missing-CLI failure into the canonical operator-visible status warning or an explicitly approved shared mapping, with a regression that renders the failed status path.

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

Yes, source-reproducible: current main returns only { cliFound }, while the shared renderer recognizes probe success or failure only through boolean probe.ok.

Is this the best way to solve the issue?

No. The producer result is the right owner boundary, but the branch does not connect its error text to the account error or warning surface that operators need.

Full review comments:

  • [P1] Project the failed probe into an actionable status issue — extensions/raft/src/channel.ts:64-72
    The new error remains only inside probe. Account snapshots and status-issue collection do not map generic failed probes into lastError or warnings, so channels status --probe gains probe failed but still omits the promised actionable missing-CLI error. Add a Raft-owned projection or an approved shared mapping, plus an end-to-end status regression.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 2a8b322ebf52.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This is a maintainer-authored PR; the external-contributor real-behavior-proof gate does not apply.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: ⏳ waiting on author.

Label justifications:

  • P2: This repairs a bounded but user-visible diagnostic failure in the optional Raft channel’s documented verification command.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This is a maintainer-authored PR; the external-contributor real-behavior-proof gate does not apply.

Evidence

What I checked:

  • Current producer omits the canonical outcome: Current main returns only cliFound from the Raft probe, so generic status consumers have no ok or error field to classify. (extensions/raft/src/channel.ts:64, 2a8b322ebf52)
  • Shared renderer consumes probe.ok: The terminal status renderer emits works or probe failed only when the account probe supplies a boolean ok. (src/commands/channels/status.runtime.ts:174, 2a8b322ebf52)
  • Proposed error is not projected into warnings: Account snapshots retain runtime lastError, while issue collection considers runtime state and plugin-owned collectors; neither path maps a generic { ok: false, error } probe into an account error or warning. (src/channels/plugins/status.ts:62, 2a8b322ebf52)
  • PR test is producer-only: The new test invokes raftPlugin.status.probeAccount directly and proves its object shape, but does not exercise the Gateway snapshot or rendered status path where the actionable error is required. (extensions/raft/src/channel.test.ts:55, 7e6914fce237)
  • Feature provenance: Blame attributes the current diagnostic-only Raft probe to the Raft channel introduction carried in this commit; its history predates the PR and establishes the relevant owner path. (extensions/raft/src/channel.ts:65, a7a0399fea74)
  • PR scope: The branch changes only the Raft producer and its colocated test; git diff --check reports no whitespace errors. (extensions/raft/src/channel.ts:64, 7e6914fce237)

Likely related people:

  • Vincent Koc: Introduced the Raft wake-bridge channel and later maintained its bridge protocol. (role: feature owner; confidence: high; commits: 2b50bbf15269, b39e905b694d; files: extensions/raft/src/channel.ts, extensions/raft/src/gateway.ts)
  • Jesse Merhi: Current blame attributes the Raft status-probe implementation to this contributor. (role: recent area contributor; confidence: high; commits: a7a0399fea74; files: extensions/raft/src/channel.ts)

Rank-up moves

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

  • Project missing CLI detection into the account warning or error path.
  • Add a regression that exercises the failed probe through Gateway status rendering.

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 (1 earlier review cycle)
  • reviewed 2026-08-13T11:12:04.254Z sha 7e6914f :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 13, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

ClawSweeper finding reviewed and skipped: its projection premise is incorrect on this exact head.

The existing shared Gateway flow already consumes the shape this PR now returns:

  • src/gateway/server-methods/channels.ts:200 recognizes exactly a non-empty { ok: false, error: string } result.
  • src/gateway/server-methods/channels.ts:460 applies the probe failure to snapshot.lastError when no stronger runtime error exists.
  • src/commands/channels/shared.ts:98 renders a non-empty account lastError as the operator-visible error:... status bit.
  • src/commands/channels/status.runtime.ts:174 independently renders boolean probe.ok as works or probe failed.

So the Raft producer repair completes both existing shared consumers: ok drives the probe result and error reaches the account error text. Adding a Raft-owned status issue would duplicate shared policy and is not the better owner boundary. The focused producer regression, existing shared Gateway projection coverage, exact-head CI, and hosted gate are sufficient for this bounded plugin-local fix.

@steipete
steipete merged commit baf85e6 into main Aug 13, 2026
162 of 166 checks passed
@steipete
steipete deleted the fix/raft-probe-outcome branch August 13, 2026 11:21
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: raft Channel integration: Raft maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Raft CLI detection is missing from channel status outcome

1 participant