Skip to content

fix(doctor): show disabled automations during authority reauthorization - #127998

Merged
steipete merged 1 commit into
openclaw:mainfrom
MonkeyLeeT:codex/fix-127858-doctor-list-all
Aug 23, 2026
Merged

steipete merged 1 commit into
openclaw:mainfrom
MonkeyLeeT:codex/fix-127858-doctor-list-all

Conversation

@MonkeyLeeT

@MonkeyLeeT MonkeyLeeT commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

Closes #127858

What Problem This Solves

Doctor counts disabled automations when reporting scheduled-authority reauthorization debt, but its remediation command previously hid those disabled rows. Operators could therefore see a count larger than the inventory they were told to review.

Why This Change Was Made

Doctor now recommends openclaw automations list --all, matching the all-row authority classification while preserving the established enabled-only default list behavior.

The regression test exercises the Doctor boundary with one enabled and one disabled affected automation. This is the canonical hint-only repair: filtering disabled rows out of Doctor would hide real authority debt, while changing the default list behavior would alter existing CLI semantics.

User Impact

Operators following Doctor's remediation can enumerate every automation included in its warning count, including disabled automations retained in history.

Evidence

  • Pre-fix regression: the new Doctor-boundary test failed because Doctor reported 2 affected automations but returned openclaw automations list instead of openclaw automations list --all.
  • Focused post-fix tests: 4 shards passed, 267 tests total, covering Doctor, scheduled-tool-policy migration, cron service list filtering, and the automation CLI.
  • Changed-file validation: the repository changed-file gate passed, including formatting, lint, type checks, architecture guards, database-first checks, and import-cycle checks.
  • Inspectable real-behavior proof: redacted terminal transcript from reviewed head 8973e8d uses the built CLI, production SQLite store, and real loopback Gateway. Doctor reports both affected rows and recommends list --all; the default list returns only the enabled affected row, while list --all returns both and marks the disabled row disabled.
  • Review: the single draft autoreview pass found no actionable issues and rated the patch correct (0.99 confidence).
  • Production LOC: +1/-1 (net 0). Test LOC: +35/-0.

@clawsweeper

clawsweeper Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: XS triage: blank-template Candidate: PR template appears mostly untouched. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Aug 22, 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 Aug 22, 2026
@clawsweeper

clawsweeper Bot commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 22, 2026, 3:31 PM ET / 19:31 UTC.

ClawSweeper review

What this changes

Updates Doctor’s scheduled-authority remediation hint to use openclaw automations list --all and adds coverage for a disabled affected automation.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

This PR remains necessary: current main still gives a default inventory command that omits disabled automations despite Doctor counting them. The one-line hint change preserves the documented default and makes the remediation actionable.

Priority: P2
Reviewed head: 8973e8dabb25f2c81d482e4a77c47ed8577a6c08

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, source-aligned repair with useful regression coverage and direct operator-flow proof.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): A redacted after-fix terminal transcript uses the built CLI, production SQLite store, and loopback Gateway to show Doctor’s count and the complete --all inventory.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): A redacted after-fix terminal transcript uses the built CLI, production SQLite store, and loopback Gateway to show Doctor’s count and the complete --all inventory.
Evidence reviewed 6 items Current main mismatch: Doctor counts both legacy and invalid scheduled-policy job arrays, but its current remediation hint directs operators to the default inventory command.
CLI contract: The automations alias registers list --all; without it the CLI sends includeDisabled: false, and the cron service filters disabled jobs.
Documented behavior: The CLI documentation explicitly states that the default list shows enabled jobs and --all includes disabled jobs.
Findings None None.
Security None None.

Live Verification

Command: pnpm openclaw automations list --help

Result: PASS (completed)

pnpm openclaw automations list --help
runner@runnervm76f27:/tmp/clawsweeper-live-proof-127998-K9Qv9w/target$ pnpm openclaw automations list --help
$ node scripts/run-node.mjs automations list --help
pnpm openclaw automations list --help
[openclaw] Building TypeScript (dist is stale: missing_build_stamp - build stamp missing).
[openclaw] Building bundled plugin assets.
[canvas] build: node scripts/bundle-a2ui.mjs
[log] ‹DIR›/a2ui.bundle.js  chunk │ size: 399.96 kB
[log] ‹DIR›/a2ui-v0.9.bundle.js  chunk │ size: 615.66 kB
[log]
[success] rolldown v1.2.0 Finished in 106.26 ms
[diffs] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts curated
[diffs-language-pack] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts full
[discord] build: node --import tsx ../../scripts/build-discord-activity-sdk.mts
[tsdown-build] invocation 1/2 finished in 0.7s
node_modules/playwright-core/lib/coreBundle.js (65821:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65821:29 ]
       │
 65821 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/playwright-core/lib/coreBundle.js (65828:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65828:29 ]
       │
 65828 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2343:30) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2343:31 ]
      │
 2343 │           ASM_CONSTS[start] = eval(func);
      │                               ──┬─
      │                                 ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2366:32) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2366:33 ]
      │
 2366 │           moduleExports[name] = eval(func);
      │                                 ──┬─
      │                                   ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

[tsdown-build] invocation 2/2 finished in 14.2s
[plugin-control-plane-loads] verified 35 built modules with native require and checked doctor closures
runtime-postbuild: 11 phases completed in 4327ms (slowest: built plugin control-plane loads 3602ms)
│
◇

OpenClaw 2026.8.1 (8973e8d) — All your chats, one OpenClaw.

Usage: openclaw cron list [options]

List automations

Options:
  --agent ‹id›           Filter by agent id
  --all                  Include disabled jobs (default: false)
  --expect-final         Wait for final response (agent) (default: false)
  -h, --help             Display help for command
  --json                 Output JSON (default: false)
  --
… output truncated …

Assertions:

  • PASS expect_output: Include disabled jobs

How this fits together

Doctor normalizes persisted automation rows into scheduled-authority findings and gives operators a remediation command. The automation CLI queries the Gateway and normally omits disabled jobs unless --all is selected.

flowchart LR
  A[Persisted automation rows] --> B[Doctor normalization]
  B --> C[Authority warning]
  C --> D[Remediation hint]
  D --> E[Automation CLI]
  E --> F[Gateway inventory]
  F --> G[Enabled and disabled jobs]
Loading

Before merge

  • Resolve merge risk (P1) - The branch is behind current main, so merge should use normal exact-head validation after the final merge result is refreshed.
  • Complete next step (P2) - This active PR already owns the concrete repair; the remaining work is ordinary exact-head merge validation.
Agent review details

Security

None.

PR surface

Source 0, Tests +35. Total +35 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 1 35 0 +35
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 36 1 +35

Review metrics

Metric Value Why it matters
Production versus test delta production +1/-1 (net 0); tests +35/-0 The repair changes one operator-facing hint and adds focused boundary coverage without growing production code.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/commands/doctor/cron/index.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #127858
Summary: This PR is the focused candidate fix for the linked Doctor remediation mismatch.

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 enabled-only default inventory and merge this hint-and-regression repair after exact-head validation.
  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 enabled-only default inventory and merge this hint-and-regression repair after exact-head validation.

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

Yes, by source inspection: current main counts all affected stored jobs while its default inventory path excludes disabled ones; the supplied after-fix terminal transcript demonstrates the same distinction.

Is this the best way to solve the issue?

Yes. Changing only the hint is the narrowest owner-boundary fix; filtering Doctor’s count or changing the default CLI contract would alter valid behavior.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded operator-facing diagnostic mismatch that does not alter execution or persisted data.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): A redacted after-fix terminal transcript uses the built CLI, production SQLite store, and loopback Gateway to show Doctor’s count and the complete --all inventory.
  • proof: sufficient: Contributor real behavior proof is sufficient. A redacted after-fix terminal transcript uses the built CLI, production SQLite store, and loopback Gateway to show Doctor’s count and the complete --all inventory.

Evidence

What I checked:

  • Current main mismatch: Doctor counts both legacy and invalid scheduled-policy job arrays, but its current remediation hint directs operators to the default inventory command. (src/commands/doctor/cron/index.ts:302, d0700b3bc26b)
  • CLI contract: The automations alias registers list --all; without it the CLI sends includeDisabled: false, and the cron service filters disabled jobs. (src/cli/cron-cli/register.cron-add.ts:55, d0700b3bc26b)
  • Documented behavior: The CLI documentation explicitly states that the default list shows enabled jobs and --all includes disabled jobs. Public docs: docs/cli/cron.md. (docs/cli/cron.md:323, d0700b3bc26b)
  • Focused regression coverage: The added test persists enabled and disabled tool-bearing automations, expects both in Doctor’s count, and requires the all-row inventory hint. (src/commands/doctor/cron/index.test.ts:314, 8973e8dabb25)
  • After-fix behavior proof: The supplied redacted terminal transcript runs the built CLI against a production SQLite store and loopback Gateway: Doctor reports two affected rows, the default list returns one enabled row, and --all returns both. (8973e8dabb25)
  • History routing: Current-main blame attributes the warning loop and original default-list hint to the recent Doctor cron area change. (src/commands/doctor/cron/index.ts:302, 0ab65784782d)

Likely related people:

  • Josh Lehman: Current-main blame attributes the affected Doctor warning and original remediation hint to this contributor’s commit. (role: current behavior author; confidence: high; commits: 0ab65784782d; files: src/commands/doctor/cron/index.ts)

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 (4 earlier review cycles)
  • reviewed 2026-08-22T17:39:23.729Z sha 8973e8d :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-22T17:52:47.718Z sha 8973e8d :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-22T18:21:03.604Z sha 8973e8d :: needs maintainer review before merge. :: none
  • reviewed 2026-08-22T18:49:03.251Z sha 8973e8d :: needs maintainer review before merge. :: none

@MonkeyLeeT

Copy link
Copy Markdown
Contributor Author

Post-fix real-behavior proof for reviewed head 8973e8dabb25f2c81d482e4a77c47ed8577a6c08.

This used the built CLI (dist/entry.js), a production saveCronStore SQLite store in an isolated state directory, and a real loopback Gateway. No Doctor, inventory, or Gateway mocks were used. Paths are redacted; the state contained no credentials.

Redacted terminal transcript
$ git rev-parse HEAD
8973e8dabb25f2c81d482e4a77c47ed8577a6c08

$ node dist/entry.js --version
OpenClaw 2026.8.1 (8973e8d)

$ # Seed one enabled and one disabled legacy tool-bearing automation through saveCronStore
{
  "seeded": [
    {
      "id": "legacy-authority-enabled",
      "enabled": true
    },
    {
      "id": "legacy-authority-disabled",
      "enabled": false
    }
  ]
}

$ OPENCLAW_STATE_DIR=‹STATE_DIR› node dist/entry.js doctor --lint --only core/doctor/legacy-cron-store --json
{"ok":false,"checksRun":1,"checksSkipped":58,"findings":[{"checkId":"core/doctor/legacy-cron-store","severity":"warning","message":"2 tool-bearing automations require explicit scheduled authority reauthorization.","path":"‹STATE_DIR›/state/openclaw.sqlite","requirement":"cron-scheduled-authority-reauthorization","fixHint":"Review with openclaw automations list --all and reauthorize with openclaw automations edit <id> --tools <tool,...>."}]}
# exit 1 is expected because Doctor emitted the warning

$ OPENCLAW_STATE_DIR=‹STATE_DIR› node dist/entry.js gateway run --port 19186 --bind loopback
[gateway] http server listening (16 plugins; 2.6s)
[gateway] ready

$ OPENCLAW_STATE_DIR=‹STATE_DIR› node dist/entry.js automations list --json |
    jq '[.jobs[] | select(.id | startswith("legacy-authority")) | {id, enabled, status}]'
[
  {
    "id": "legacy-authority-enabled",
    "enabled": true,
    "status": "idle"
  }
]

$ OPENCLAW_STATE_DIR=‹STATE_DIR› node dist/entry.js automations list --all --json |
    jq '[.jobs[] | select(.id | startswith("legacy-authority")) | {id, enabled, status}]'
[
  {
    "id": "legacy-authority-enabled",
    "enabled": true,
    "status": "idle"
  },
  {
    "id": "legacy-authority-disabled",
    "enabled": false,
    "status": "disabled"
  }
]

^C
[gateway] received SIGINT; shutting down
[shutdown] completed cleanly in 81ms

Observed invariant: Doctor counted both affected persisted rows and now points to the only inventory command that exposes both. The established default list still hides the disabled row.

@MonkeyLeeT

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 22, 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 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 Aug 22, 2026
@MonkeyLeeT
MonkeyLeeT marked this pull request as ready for review August 22, 2026 18:44
@MonkeyLeeT MonkeyLeeT changed the title fix: Doctor authority remediation lists disabled automations fix(doctor): show disabled automations during authority reauthorization Aug 22, 2026
@steipete

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 23, 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:

@steipete
steipete merged commit ae9a72a into openclaw:main Aug 23, 2026
354 of 355 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

@MonkeyLeeT
MonkeyLeeT deleted the codex/fix-127858-doctor-list-all branch August 23, 2026 16:40
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. triage: blank-template Candidate: PR template appears mostly untouched.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Doctor scheduled-authority fix hint hides disabled automations in its count

2 participants