Skip to content

fix: show the plugins enable maintenance reason without debug - #169907

Merged
steipete merged 7 commits into
openclaw:mainfrom
ericcaiwx-star:codex/fix-169862-plugins-enable-reason
Oct 13, 2026
Merged

steipete merged 7 commits into
openclaw:mainfrom
ericcaiwx-star:codex/fix-169862-plugins-enable-reason

Conversation

@ericcaiwx-star

@ericcaiwx-star ericcaiwx-star commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #169862

What Problem This Solves

openclaw plugins enable can stop with only “The CLI command failed” while offline database maintenance is in progress, hiding the reason and retry instruction unless debug output is enabled.

User Impact

Commands reaching the shared CLI failure renderer show the redacted state-access refusal without debug mode. The producer's remedy stays intact: retry after active maintenance, or restart the Gateway when ownership cannot be verified. Stack traces and unrelated nested diagnostics remain hidden, and existing Gateway-contention output is preserved. There are no configuration, schema, or updater lifecycle changes.

Why This Change Was Made

The shared renderer now recognizes the stable StateDatabaseAccessError name instead of matching diagnostic prose. The state owner uses that base error for previously untyped refusals; its existing admission-pending and offline-maintenance subclasses inherit the same diagnostic name while retaining their distinct retry identities.

Worker replies and state-error hydration already preserve names; no wire-format changes or eager state-runtime import are needed in the renderer. The regressions construct the real error classes and round-trip deliberately reworded messages through the shared state-worker error graph, so changing diagnostic wording cannot silently hide the remedy again.

Original fix by @ericcaiwx-star; maintainer cleanup and coordinator-requested producer/transport correction by @steipete.

Evidence

  • Coordinator P2 addressed: CLI state-refusal classification uses one stable error name, not message prefixes or substrings. Existing producer messages are unchanged. The local maintenance guard uses the base error, preserving existing admission-pending/offline retry distinctions.
  • Regressions: prints the actionable state refusal without debug: %s covers admission, offline maintenance, and nested ownership verification with redaction and unrelated-diagnostic suppression. preserves reworded $name guidance across worker transport covers all three class forms through production encode/clone/hydrate. Existing contention, manual-recovery, update, and debug tests remain.
  • Source-verified transport: sqlite-store.worker.ts retains the failure name on refusal replies; sqlite-worker-broker-reply.ts restores it; openclaw-state-worker-error.ts serializes and hydrates names throughout nested graphs.
  • Changed-file oxlint and oxfmt passed; git diff --check passed. The parent dependency install lacks eslint-plugin-solid, so local oxlint omits only the nonmatching ui/**/*.tsx override from a temporary config. CI uses the full configuration.
  • Isolated Codex autoreview: scoped-clean, no actionable P0–P2 findings on this revision. Deslop complete.
  • Exact-head CI run 38419268762 passed at 0a948520047488f477a5647cbe2130c47e7df349: 70 jobs passed, 28 skipped, including the aggregate CI gate, production/test typechecks, and full lint. This head merges main 7896f10f9ba171a9bf411657703e6116929775f2 without any additional implementation changes.
  • Formatter regression job passed all 29 formatter tests, including the state-refusal and transport regressions. The six cases took 12, 17, 20, 23, 18, and 12 ms. Their 13-file compact group passed 338 tests (one skipped) in 26.09 seconds; per-file wall time is not reported separately.
  • The previous run 38405541427 failed the native same-session test in three attempts (two placement-authority errors and one 360-second timeout), and its initial UI run failed the Details-panel Escape test. After merging current main, both lanes passed. checks-node-changed-2, job 115381464634 explicitly passed test/e2e/qa-lab/runtime/required-native-same-session.e2e.test.ts: the test took 93.566 seconds, the file invocation took 104.57 seconds, all four turn pairs completed, and cleanup confirmed the node, Gateway, and provider stopped. This establishes a passing current head; it does not identify the cause of the earlier failures.
  • Latest inspected ClawSweeper review, on prior head 23aae316ab33f2377833fb85413e7e591855003b, reported no actionable code findings. Its remaining request was live proof only, intentionally skipped under the explicit maintainer policy below.
  • Live proof, local tests/typechecks, and negative controls are intentionally skipped per maintainer policy (2026-10-13: “relax testing and trust PR CI, just lint”). No Gateway or remote lease was started. PR CI is the proof for this work order; ClawSweeper's proof-only request does not change that instruction.

Diff versus main: production +25/-24 (net +1); tests +79/-0; docs +3/-0. The additional production line supplies the coordinator-requested stable producer identity. Local test wall time is unmeasured; exact-head CI timings are recorded above.

Contributor-reported prior-head behavior evidence

At a42af0f503cc9db765b4b0cdd7dbb87385575de9, the contributor reported node dist/index.js plugins enable github with isolated existing state and a live maintenance holder: refusal included the reason, and retry succeeded after the holder released ownership. This remains prior-head contributor evidence, not a fresh maintainer run.

The retryable state-admission refusal was collapsed to the doctor hint, so operators could not tell that maintenance was still holding the database.
@ericcaiwx-star
ericcaiwx-star marked this pull request as ready for review October 12, 2026 13:10
@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: XS labels Oct 12, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 12, 2026
@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

The PR displays redacted state-access refusal reasons and recovery instructions in ordinary CLI output.

Example: Run openclaw plugins enable github while offline state maintenance holds the database.

  • Before: The CLI reports “The CLI command failed” and suggests Doctor without explaining the refusal.
  • After: The CLI displays the maintenance reason and instructs the operator to retry when maintenance finishes.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The patch is focused and source-supported, but supplied evidence does not satisfy this external PR's shipped-behavior proof gate.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Operators cannot tell why plugin enablement failed or when to retry without enabling debug output.
Reason: The narrow diagnostic correction restores the existing actionable-error contract and preserves intentionally terse unrelated failures.

Merge readiness

⛔ Blocked before merge - 1 item remains

This PR addresses a verified CLI diagnostic bug that remains on current main; no actionable code findings were identified.

Priority: P2
Reviewed head: 0a948520047488f477a5647cbe2130c47e7df349

Before merge

  • Add real behavior proof - The prior-head plugins-enable report predates the stable producer-name and nested-refusal correction, and the inspected images exercise unrelated Control UI behavior; provide redacted terminal output or a terminal screenshot from the revised shipped CLI showing maintenance refusal, recovery guidance, and successful retry after maintenance ends, removing API keys, IPs, phone numbers, and non-public endpoints. 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.

Findings

None.

Tests

  • Missing end-to-end proof: Supplied evidence does not show the revised shipped CLI refusing during maintenance, displaying recovery guidance, and succeeding after release; a base-failing regression run is also not supplied.
Agent review details

How this fits together

The state owner rejects unavailable database access, worker transport preserves error names, and the shared CLI renderer turns those failures into operator guidance.

flowchart LR
  A[Plugin CLI command] --> B[State access owner]
  B --> C[Named refusal error]
  C --> D[Worker error transport]
  D --> E[Shared CLI renderer]
  E --> F[Redacted recovery guidance]
Loading

Technical review

Best possible solution:

Keep the focused shared-renderer fix with producer-owned error identity and unchanged state-access enforcement.

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

The official-release report and current-main state-owner and CLI-renderer paths establish the failure mechanism; no target code was executed during this review.

Is this the best way to solve the issue?

The shared renderer is the correct owner, and stable producer identity avoids wording-dependent classification while preserving redaction and retry distinctions.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • CLI failure presentation changes intended behavior with a stated reason (d0b48d6: Lead with concise guidance while retaining detailed diagnostics on demand; earlier cause suppression protected ordinary output from internal transport details.)
  • State-owner refusal identity keeps the original intent (6c1e166: Extract persisted ownership admission while preserving ownership policy and distinct retryable refusal behavior.)
  • Foreign offline-maintenance refusal keeps the original intent (1b11f9d: Skip scheduled checkpoint warnings during legitimate foreign maintenance without making non-schema maintenance retryable cold admission.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 6c1e166 adds src/infra/gateway-state-owner-record.ts:14 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 6c1e1667bd61; files: src/infra/gateway-state-owner-record.ts)
  • Vincent Koc: Raw commit d0b48d6 adds src/cli/failure-output.ts:224 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: d0b48d63efb8; files: src/cli/failure-output.ts)

PR surface

Source +1, Tests +79, Docs +3. Total +83 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 25 24 +1
Tests 1 79 0 +79
Docs 1 3 0 +3
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 107 24 +83

Review metrics

Metric Value Why it matters
Production versus test LOC Production +25/-24; tests +79/-0 Net production growth is one line; the added cases cover refusal guidance, redaction, nested errors, and transport preservation.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Hidden maintenance guidance causes avoidable confusion in an advanced CLI workflow, with limited blast radius.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (6 earlier review cycles)
  • reviewed 2026-10-12T13:16:03.470Z sha 28a75d7 :: needs real behavior proof before merge. :: [P2] Keep existing contention output outside the new reason gate
  • reviewed 2026-10-12T13:52:37.425Z sha a42af0f :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-12T14:15:20.303Z sha a42af0f :: needs maintainer review before merge. :: none
  • reviewed 2026-10-13T13:16:33.293Z sha 0dba5a7 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-13T13:39:10.995Z sha 23aae31 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-13T14:18:36.669Z sha 23aae31 :: needs real behavior proof before merge. :: none

Reviewed October 13, 2026, 11:15 AM ET / 15:15 UTC (Revision 7).

The maintenance reason belongs on admission refusals. The existing contention hint stays a two-line wait message, without a new Reason line.
@ericcaiwx-star

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The contention Reason line is gone. Admission and offline-maintenance refusals still print the redacted reason. The PR body now includes the shipped node dist/index.js plugins enable github refusal and the successful retry after the maintenance holder exited.

@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@ericcaiwx-star

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The PR body now has shipped node dist/index.js plugins enable github output from the changed formatter: the [openclaw] Reason: maintenance line and the wait hint, without debug, then a successful retry after the maintenance holder exited. The earlier Cannot admit plugins.enable trace was the unchanged local-owner path and has been replaced.

@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 12, 2026
Keep maintenance and ownership verification remedies visible without debug output. Preserve nested refusal reasons through the shared CLI renderer, avoid loading the state-lock runtime, and retain terse contention and redacted debug behavior.
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: S and removed size: XS labels Oct 13, 2026
@clawsweeper clawsweeper Bot added 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. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 13, 2026
Name refusals at their state owner while retaining the distinct pending and offline maintenance subclasses. Preserve recovery messages through worker serialization and match only the stable name in the CLI renderer.
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Oct 13, 2026
@steipete

Copy link
Copy Markdown
Contributor

Landing stopped on the final authorized rerun: CI run 38405541427, attempt 3 at 23aae316ab33f2377833fb85413e7e591855003b again failed checks-node-changed-2 in test/e2e/qa-lab/runtime/required-native-same-session.e2e.test.ts with GatewayClientRequestError: Error: Session 96a32762-30e8-4caf-a4ed-9fa6717d6dd4 placement authority changed (file duration 85.32 s). The UI lane passed; the aggregate CI gate remains red. No merge was attempted.

The coordinator's investigation attributes this to a pre-existing intermittent placement-authority defect independent of this PR: the unchanged test passed 2/2 on trusted main (91 s and 82 s test bodies), and the earlier CI failures contained no state-database refusal. The final retry likewise contains no state-database refusal. The placement error originates from the plain-Error guard in src/gateway/worker-environments/placement-read-authority.ts when a retained read is revoked or a claim publication is pending. This PR changes diagnostic names; existing instanceof classification and worker-error hydration preserve admission behavior. Scheduled main CI does not run this file, so there is no matching scheduled-main proof. Passing local replays do not establish that the intermittent defect is fixed.

No further rerun or CI exception was applied. Leaving this PR open for the coordinator's exception-route decision.

@steipete
steipete merged commit 656c851 into openclaw:main Oct 13, 2026
155 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
…aw#169907)

* fix(cli): show the plugins enable maintenance reason without debug

The retryable state-admission refusal was collapsed to the doctor hint, so operators could not tell that maintenance was still holding the database.

* fix(cli): keep Gateway contention output terse

The maintenance reason belongs on admission refusals. The existing contention hint stays a two-line wait message, without a new Reason line.

* fix(cli): preserve actionable state refusal diagnostics

Keep maintenance and ownership verification remedies visible without debug output. Preserve nested refusal reasons through the shared CLI renderer, avoid loading the state-lock runtime, and retain terse contention and redacted debug behavior.

* fix(cli): classify state access refusals by stable error name

Name refusals at their state owner while retaining the distinct pending and offline maintenance subclasses. Preserve recovery messages through worker serialization and match only the stable name in the CLI renderer.

---------

Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S 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.

[Bug]: plugins enable hides its failure reason ("The CLI command failed") unless OPENCLAW_DEBUG=1

2 participants