Skip to content

refactor(commands): deslop commands fourth pass - #158940

Merged
steipete merged 8 commits into
mainfrom
deslop/l84-commands4
Sep 28, 2026
Merged

steipete merged 8 commits into
mainfrom
deslop/l84-commands4

Conversation

@steipete

@steipete steipete commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Related: #156931, #156622, #158487

Depends on #159208. READY-TO-LAND after the Gateway prerequisite. Both PRs target main and remain open and unarmed; land Gateway first.

What Problem This Solves

The fourth cleanup pass over src/commands removes repeated traversal, result projection, local types, and forwarding layers that make command behavior harder to maintain.

User Impact

No intended user-visible change. Command names, flags, help, exit codes, JSON shapes, stdout/stderr routing, prompts, credential handling, config keys, and Doctor findings/repair ordering remain unchanged. No schema, migration policy, retention, permission, dependency, or publication change.

Why This Change Was Made

The sweep read the entire command subtree, starting with the largest files untouched by earlier passes. The commands-only range removes 1,515 net production lines across 123 files through existing owners:

  • Share provider/model and MCP migration traversal, vLLM parameter handling, TTS record creation, and ordered alias cleanup, preserving precedence and messages.
  • Reuse channel-model slot traversal for Doctor inspection and repair; consolidate native asset discovery and plugin repair options without changing admission or transaction ownership.
  • Share heartbeat rollback diagnostics and cron previews; remove redundant report types, archive forwarders, and Workshop projections while preserving durability and recovery checks.
  • Consume the exec policy owner's effective decision and daemon runtime formatter directly; share equivalent memory-probe and workspace error output.
  • Consolidate agent deletion output, agent-exec result/environment handling, channel resolution/status projection, and backup manifest lookup while retaining public fields and transport behavior.
  • Remove forwarding barrels with complete caller and test-mock cutovers; simplify custom-provider retry state, remote inference projection, skill filtering, and auth labels.
  • Remove an orphaned channel-status note wrapper and move its locale-title coverage to the real setup flow. Keep unused vLLM/auth helpers private after their external callers disappear.
  • Accumulate smaller verified helper reuse, dead intermediate state, duplicate guards, and narrating-comment cleanup.

Evidence

Head: f6dd976b4ca4de66b4076322f5bfc9dfc0d299b3. Independent review has no accepted/actionable P0–P2 finding. Exact-head CI passed: 158 successful jobs, 20 skipped.

Final Blacksmith Testbox proof uses that green CI run's exact merge 4f8b8638d269891427f0b7e4bbacad92cac464b6, tree cf167c0485b9bf16941042a466edb9b3d6e9997d, against its main parent 66679bfa3ec1ec7bd360ad6af5a3a0c269d6bdcd. The merge's second parent is the PR head above, and its stable patch ID matches the reviewed branch. All 50,207 tracked files were verified against their committed bytes and modes.

Provider: blacksmith-testbox; completed lease tbx_01m3jzxt3evb7j4511jf2zrgmk; proof runner. Commands run through node scripts/crabbox-wrapper.mjs with frozen dependency installation:

  • node scripts/run-vitest.mjs: 24 affected files passed (125s), nine cross-shard files passed (39s), nine Gateway history files passed (84s), integration files passed (23s), Doctor overlaps passed (41s), continuation cases passed (20s), and tool-search migration passed (15s). The earlier 193-file/eight-shard run remains retained proof for unchanged cleanup patches.
  • node scripts/check-changed.mjs --base 66679bfa3ec1ec7bd360ad6af5a3a0c269d6bdcd: all non-lint phases passed, including every production/test type graph and all three dead-export scans. Its sole failure was an unchanged main UI file above the line limit; fix(ci): keep chat attachment controls within lint limit #160159 repaired that owner. All five core lint stripes then passed (341s), and targeted UI changed checks passed (448s), completing the affected gate coverage.
  • pnpm build: candidate passed (429s), comparison base passed (394s). Canonical candidate packaging and integrity checks passed (61s).
  • Real pnpm openclaw invocations: all 44 help surfaces matched raw stdout/stderr/exit bytes; 90 invocations including isolated Doctor and Doctor/fix passed (107s). Four additional Doctor invocations also matched raw streams/exit codes and repaired seeded permissions. Saved config differed only in wizard.lastRunAt; each timestamp was validated inside its invocation, each saved-file hash was verified independently, and all remaining bytes/state matched. Both databases passed integrity/role checks.
  • pnpm test:docker:published-upgrade-survivor, using published [email protected] and workshop-doctor-recovery: passed (95s). It exercises malformed-state refusal, baseline Doctor repair, the installed published updater installing candidate bytes, Workshop migration, and candidate Doctor repair. Manual restart mode (--no-restart) leaves service-restart coverage outside this proof.

Added resolver ordering/projection cases took 2ms and 1ms; their 11-case file took 17.56s wall with one worker. The moved locale-title case took 200ms; its five-case setup file took 15.31s wall. Existing CSS size advisories appeared equally in both builds, below the hard ceiling.

Fixes Found Along the Way

Canonical-owner mock cutovers, orphan internal exports, shadowed locals, and an import through a removed barrel were corrected. Session-store error construction remains unchanged to preserve CLI text. Assertion baselines only shrink. The Gateway transcript-read race is isolated in the prerequisite PR.

Captured unrelated failures were resolved through their existing upstream owners: #159964 repairs the installer smoke assertion, and #160015 includes the already-required Undici peer in fresh npm installs. The latter was already in the green CI merge tested above; no duplicate repair PR or dependency-version change was added.

Two proof-harness mistakes were corrected without product edits: carrier commits require tree identity checks, and builds must be consumed before wrapper resync changes the carrier SHA. The original raw captures remain unchanged; timestamp-dependent saved state was verified structurally rather than claiming byte-identical timestamps.

The CI-only line-limit repair in #160159 is merged on main (2e95cdba84c2b7f697123aa0561da3e454605d7e). It moves the unchanged image data-URL decoder into the existing image owner. The composed follow-up tree eec464830c40d65420a419a9753eed5fef85ebc3 passed 34 existing attachment tests, full core lint, UI changed checks, and the UI build. No commands/Gateway patch changed; their earlier passing proof remains valid. Both deslop and Gateway PRs are left unmerged.

@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
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.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes commands Command implementations docker Docker and sandbox tooling size: XL labels Sep 26, 2026
@steipete
steipete marked this pull request as ready for review September 26, 2026 14:52
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 26, 2026
@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 28, 2026, 1:57 AM ET / 05:57 UTC (Revision 20).

ClawSweeper review

What this changes

The branch consolidates CLI, Doctor, setup, backup, and channel command helpers and adjusts Gateway transcript reads during unrelated registry refreshes.

Merge readiness

⛔ Blocked before merge - 4 items remain

This PR still contains distinct command cleanup absent from current main. The earlier review’s upgrade-proof concern is addressed by the recorded published-updater and Doctor/Workshop run; the separately reviewed Gateway prerequisite remains open.

Priority: P3
Reviewed head: f6dd976b4ca4de66b4076322f5bfc9dfc0d299b3

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Direct CLI, Gateway-boundary, and published-updater evidence supports a broad cleanup whose remaining issue is landing order.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The captured PR body ties the changed command and Doctor owners to real openclaw CLI and Doctor/fix invocations with matched output and state, and records a published-updater-to-candidate Workshop/Doctor survival run. Gateway tests hold a native primary-worker reply through registry churn and reject primary-file replacement before publication. The linked lease workflow was cancelled, so its conclusion is not counted as a pass; the detailed recorded command results and exact-head CI are the supporting evidence. Existing-state upgrade compatibility is supported by the published-driver candidate cell.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The captured PR body ties the changed command and Doctor owners to real openclaw CLI and Doctor/fix invocations with matched output and state, and records a published-updater-to-candidate Workshop/Doctor survival run. Gateway tests hold a native primary-worker reply through registry churn and reject primary-file replacement before publication. The linked lease workflow was cancelled, so its conclusion is not counted as a pass; the detailed recorded command results and exact-head CI are the supporting evidence. Existing-state upgrade compatibility is supported by the published-driver candidate cell.
Evidence reviewed 8 items Pinned introduced change: The introduced Gateway hunk limits cross-store discovery to display-history requests and retains primary-file checks for exact reads; the command migration hunk consolidates existing repair traversal.
Current-main necessity: The command and Gateway files still differ from current main, and the PR head is not an ancestor of current main or contained in a local release tag.
Upgrade and direct behavior proof: The captured PR body records byte-matched output for 44 help surfaces, 90 real openclaw invocations including Doctor/fix, and a published [email protected] updater installing the candidate before Workshop migration and candidate Doctor repair. It records matching remaining state apart from the expected wizard timestamp. These statements address the prior review’s specific rank-up request; the linked Testbox lease workflow itself concluded cancelled, so its status alone is not a pass claim.
Findings None None.
Security None None.

How this fits together

OpenClaw commands turn operator CLI requests into setup, repair, and status actions that can read or update configuration and stored state. The Gateway transcript reader serves session-history requests from that state.

flowchart LR
A[CLI request] --> B[Command handlers]
B --> C[Doctor and setup]
C --> D[Config and state]
B --> E[CLI output]
F[History request] --> G[Gateway transcript reader]
D --> G
G --> H[Session history]
Loading

Before merge

  • Resolve merge risk (P1) - The dedicated Gateway transcript-read prerequisite remains open; landing this broad branch first would publish that history-read change through the cleanup PR instead of the requested separate sequence.
  • Complete next step (P2) - Land fix(gateway): keep transcript reads available during registry refresh #159208 first, then submit this PR through the native landing gates.
  • Resolve review confidence - ClawSweeper must reach high confidence before merge readiness is known.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

None.

Stored data model

Persistent data-model change detected: database schema: src/commands/backup-verify-manifest.ts, migration/backfill/repair: src/commands/doctor-auth-migration-receipts.ts, migration/backfill/repair: src/commands/triage-handoff.ts, unknown-truncated-pull-files. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Merge-risk options

Maintainer options:

  1. Land the Gateway prerequisite first (recommended)
    Merge the dedicated transcript-read fix, then submit this cleanup through the native gates against the resulting main branch.

Technical review

Best possible solution:

Keep one owner for each command and migration operation while preserving existing CLI output, stored-state recovery, and primary transcript authority.

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

Not applicable: this is a refactor rather than a reported defect. The PR records direct CLI, Doctor, update, and Gateway-boundary comparisons for behavior preservation.

Is this the best way to solve the issue?

Yes: the sampled changes reuse existing owners and retain explicit primary transcript checks. The separate Gateway fix should land first as requested.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is a behavior-preserving maintenance cleanup with no established urgent user regression.
  • merge-risk: 🚨 compatibility: Doctor and command refactors touch existing config and recovery behavior, although the recorded published-updater run materially reduces upgrade uncertainty.
  • merge-risk: 🚨 session-state: The introduced Gateway patch changes transcript-read admission during registry churn; native reply and primary-file replacement cases cover its key boundary.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The captured PR body ties the changed command and Doctor owners to real openclaw CLI and Doctor/fix invocations with matched output and state, and records a published-updater-to-candidate Workshop/Doctor survival run. Gateway tests hold a native primary-worker reply through registry churn and reject primary-file replacement before publication. The linked lease workflow was cancelled, so its conclusion is not counted as a pass; the detailed recorded command results and exact-head CI are the supporting evidence. Existing-state upgrade compatibility is supported by the published-driver candidate cell.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured PR body ties the changed command and Doctor owners to real openclaw CLI and Doctor/fix invocations with matched output and state, and records a published-updater-to-candidate Workshop/Doctor survival run. Gateway tests hold a native primary-worker reply through registry churn and reject primary-file replacement before publication. The linked lease workflow was cancelled, so its conclusion is not counted as a pass; the detailed recorded command results and exact-head CI are the supporting evidence. Existing-state upgrade compatibility is supported by the published-driver candidate cell.

Evidence

What I checked:

  • Pinned introduced change: The introduced Gateway hunk limits cross-store discovery to display-history requests and retains primary-file checks for exact reads; the command migration hunk consolidates existing repair traversal. (src/config/sessions/session-history-worker-runtime.ts:369, f6dd976b4ca4)
  • Current-main necessity: The command and Gateway files still differ from current main, and the PR head is not an ancestor of current main or contained in a local release tag. (src/commands/doctor/shared/legacy-config-migrations.runtime.models.ts:23, 1fe560c198c2)
  • Upgrade and direct behavior proof: The captured PR body records byte-matched output for 44 help surfaces, 90 real openclaw invocations including Doctor/fix, and a published [email protected] updater installing the candidate before Workshop migration and candidate Doctor repair. It records matching remaining state apart from the expected wizard timestamp. These statements address the prior review’s specific rank-up request; the linked Testbox lease workflow itself concluded cancelled, so its status alone is not a pass claim. (f6dd976b4ca4)
  • Exact-head CI: The completed CI run reports success for the pinned PR head. (f6dd976b4ca4)
  • Gateway prerequisite: The dedicated transcript-read PR remains open at its stated head. The current PR body explicitly requests that it land first. (f3197c247369)
  • Codex dependency signal: Doctor’s changed asset traversal identifies Codex plugins by the .codex-plugin/plugin.json marker under the Codex plugin cache, so that dependency contract is relevant. (src/commands/doctor/shared/codex-native-assets.ts:80, f6dd976b4ca4)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Jason (Json): Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Ayaan Zaidi: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (19 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-27T09:13:51.149Z sha de4bb73 :: blocked before merge. :: none
  • reviewed 2026-09-27T19:50:41.606Z sha 5dc58252aceed96684bc04ff84152142e296b810 :: blocked before merge. :: none
  • reviewed September 27, 2026, 4:47 PM ET / 20:47 UTC (Revision 14) sha unknown :: blocked before merge. :: none
  • reviewed September 27, 2026, 4:47 PM ET / 20:47 UTC (Revision 15) sha unknown :: blocked before merge. :: none
  • reviewed 2026-09-27T22:40:38.977Z sha 9a108b18e677bae37c3e7e9623df28715bb068d3 :: blocked before merge. :: none
  • reviewed 2026-09-27T23:47:02.279Z sha 3d6ccfd :: blocked before merge. :: none
  • reviewed 2026-09-28T02:18:01.189Z sha f6dd976 :: blocked before merge. :: none
  • reviewed 2026-09-28T03:23:59.086Z sha f6dd976 :: blocked before merge. :: none

@steipete
steipete force-pushed the deslop/l84-commands4 branch from 62a354f to 416a42f Compare September 26, 2026 18:56
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Sep 26, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 26, 2026
@steipete
steipete force-pushed the deslop/l84-commands4 branch from f26bac0 to 2e7fc90 Compare September 27, 2026 03:56
@openclaw-barnacle openclaw-barnacle Bot added channel: whatsapp-web Channel integration: whatsapp-web gateway Gateway runtime and removed scripts Repository scripts labels Sep 27, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. proof: sufficient ClawSweeper judged the real behavior proof convincing. labels Sep 27, 2026
@steipete
steipete force-pushed the deslop/l84-commands4 branch from 2e7fc90 to 4964d58 Compare September 27, 2026 07:12
@openclaw-barnacle openclaw-barnacle Bot removed the channel: whatsapp-web Channel integration: whatsapp-web label Sep 27, 2026
@steipete
steipete force-pushed the deslop/l84-commands4 branch from 4964d58 to de4bb73 Compare September 27, 2026 09:02
@steipete
steipete force-pushed the deslop/l84-commands4 branch from de4bb73 to 5dc5825 Compare September 27, 2026 19:37
@steipete
steipete force-pushed the deslop/l84-commands4 branch 2 times, most recently from 9a108b1 to 3d6ccfd Compare September 27, 2026 23:35
@clawsweeper clawsweeper Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 28, 2026
Prepare auxiliary store discovery only for history views that consume cross-store lineage. Preserve primary authority and cleanup checks for every request, and dispose Talk test resources even when publication rejects.
Consolidate migration traversal, command result projection, and canonical helper use. Remove forwarding layers with complete caller and mock cutovers while preserving CLI, Doctor, auth, and configuration contracts.
Keep the original session-store error construction so cause formatting cannot change CLI messages. Remove shadowed locals and simplify the partial mock without dropping assertions.
@steipete
steipete force-pushed the deslop/l84-commands4 branch from 3d6ccfd to f6dd976 Compare September 28, 2026 02:08
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 28, 2026
@steipete
steipete merged commit 617f35d into main Sep 28, 2026
264 checks passed
@steipete
steipete deleted the deslop/l84-commands4 branch September 28, 2026 06:11
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
* fix(gateway): keep transcript reads available during registry refresh

Prepare auxiliary store discovery only for history views that consume cross-store lineage. Preserve primary authority and cleanup checks for every request, and dispose Talk test resources even when publication rejects.

* fix(gateway): retain primary file identity through history delivery

* test(gateway): gate broadcasts on primary history replies

* refactor(commands): deslop commands fourth pass

Consolidate migration traversal, command result projection, and canonical helper use. Remove forwarding layers with complete caller and mock cutovers while preserving CLI, Doctor, auth, and configuration contracts.

* chore(commands): shrink removed assertion baselines

* refactor(commands): finish unused export cutover

* refactor(commands): preserve output through final cleanup

Keep the original session-store error construction so cause formatting cannot change CLI messages. Remove shadowed locals and simplify the partial mock without dropping assertions.

* refactor(commands): complete wizard auth type cutover
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations docker Docker and sandbox tooling gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant