Repository navigation
refactor(cli): deslop CLI and commands - #165900
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Derive private parser, report, factory, and option types from their owners. Remove redundant checks on producer-established facts while preserving external input validation, CLI output, and lazy command loading. Keep partial diagnostic and public SDK contracts explicit.
Reject nonregular secret files without blocking on FIFO writers. Keep asynchronous plugin activation routed to stderr until overlapping loads settle. Preserve plugin-runtime links replaced or restored during Doctor inspection, and retain configured prices for custom Mistral model IDs that match inherited object keys.
Keep partial diagnostic and selection projections explicit where callers legitimately omit fields. Preserve the archive publication callback adapter with a direct undefined-returning expression.
|
Codex review: blocked before merge. Reviewed October 5, 2026, 10:48 PM ET / October 6, 2026, 02:48 UTC (Revision 3). ClawSweeper reviewWhat this changesThe branch consolidates CLI and command types under existing owners and fixes secret-file hangs, asynchronous diagnostic routing, stale-link cleanup races, and custom Mistral model costs. Merge readiness⛔ Blocked before merge - 1 item remains Keep open: current main still needs the four edge-case fixes, and the cleanup has clear maintainer value. No actionable patch defect was found; the prior generic config/default compatibility warning is unsupported by the introduced diff. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s CLI turns command-line arguments and configuration into setup, diagnostics, maintenance, and Gateway operations. These changes affect input handling, command output, and Doctor repairs. flowchart TD
A[Arguments and configuration] --> B[CLI command parsing]
B --> C[Existing command owners]
C --> D[Secret input validation]
C --> E[Plugin activation and diagnostics]
C --> F[Doctor repair checks]
D --> G[Command results]
E --> G
F --> G
Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep CLI contracts derived from their existing owners and retain the focused boundary repairs without adding configuration or migration surface. Do we have a high-confidence way to reproduce the issue? Yes, source establishes focused triggers: an unwritten FIFO, asynchronous overlapping plugin loads, replacement during stale-link inspection, and custom Mistral IDs matching inherited keys. Execution was not repeated during this read-only review. Is this the best way to solve the issue? Yes. The patch reuses existing input, output-routing, and guarded-removal owners while removing duplicate type declarations; no concrete upgrade-breaking default or format change was found. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c439876feddf. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
c4eb6a1 to
fdb3129
Compare
|
Landing qualification for exact head The complete CI run census contains 91 jobs, and all 148 exact-head checks were inspected. The only independent failure is security-fast: HIGH The aggregate gate explicitly names that audit as its originating failure. The successful fail-fast monitor cancelled 62 CI jobs; all ended afterward with zero failed steps. Those jobs remain incomplete hosted coverage, including baseline ratchets. A superseded PR-context check was cancelled by its per-PR concurrency policy; its later same-head replacement succeeded. Security-sensitive review and dependency review statuses passed. The earlier branch-caused assertion-ratchet findings are fixed. The complete corrected patch was verified by hash on isolated Linux: all baseline/inventory checks passed, the four affected suites passed 63 tests, production types and scoped lint passed, and both runtime/static cycle checks reported zero. The broader retained proof passed 2,771 tests with four existing skips; four discovered defects have original/fixed regression controls. Independent review has no unresolved actionable findings, and native preparation is bound to this exact head. No cancelled job is represented as passing. |
* refactor(cli): deslop CLI and command contracts Derive private parser, report, factory, and option types from their owners. Remove redundant checks on producer-established facts while preserving external input validation, CLI output, and lazy command loading. Keep partial diagnostic and public SDK contracts explicit. * fix(cli): preserve input and plugin lifecycle boundaries Reject nonregular secret files without blocking on FIFO writers. Keep asynchronous plugin activation routed to stderr until overlapping loads settle. Preserve plugin-runtime links replaced or restored during Doctor inspection, and retain configured prices for custom Mistral model IDs that match inherited object keys. * refactor(cli): retain optional owner contracts Keep partial diagnostic and selection projections explicit where callers legitimately omit fields. Preserve the archive publication callback adapter with a direct undefined-returning expression. * refactor(cli): remove unused aliases and keep lazy type references * refactor(cli): preserve lifecycle contracts in lint-clean forms * test(cli): derive the resolved secret reader fixture type * refactor(cli): preserve assertion safety in inferred reports * chore(cli): shrink removed assertion baselines
What Problem This Solves
CLI and command code repeats owner types and producer guarantees, making the same contracts harder to keep consistent.
User Impact
Normal CLI text, flags, exit codes, JSON shapes, and lazy command loading stay unchanged. This also fixes four edge cases found during the sweep: blocking named-pipe file input, asynchronous plugin logs escaping to stdout, stale-link cleanup deleting a replacement, and inherited object keys corrupting custom Mistral model costs.
Why This Change Was Made
This removes 1,001 net production lines (+680/−1,681 across 137 production files), excluding tests and test support. It is one CLI/commands cleanup batch, confined to
src/cliandsrc/commands, plus regression tests, the secret-input documentation, and two shrink-only assertion-baseline removals.Fixes found along the way
Map, preserving custom model IDs such asconstructorand__proto__rather than treating inherited object properties as prices.Evidence
Independent Codex review has no unresolved actionable findings. All validation ran on isolated Linux with Node 24.21.0 and a frozen-lockfile install.
Hosted CI qualification
Exact head
eb75f70be05eee0f125b92be2e2f148cc54fb0a9was tested in CI run 37404759348. The complete census contains 91 jobs: four succeeded, 62 were cancelled, two failed, and 23 were skipped. The only independent failure is security-fast: the production-dependency audit reports HIGHsource-map-js, advisoryGHSA-68fv-2mgg-jv7q(npm ID 1241209).The current-main audit fails identically. The lockfile and both audit implementations are byte-identical between this head and current main; no changed file is an audit input. The successful fail-fast monitor recorded cancellation at 02:38:01.935 UTC. All 62 cancelled jobs ended afterward, with zero failed steps;
openclaw/ci-gatenames the audit job as its originating failure. Cancelled jobs are incomplete coverage, including hosted baseline ratchets. All ratchets passed separately on the source-verified remote patch. Security-sensitive review and dependency review statuses passed.The earlier PR attempt also found three branch-caused assertion-ratchet issues. Those are corrected and independently reviewed; two obsolete allowances were removed. No branch-caused failure is being excused by the inherited audit.
Changed-test cost: single-worker wall seconds
Measured with
node scripts/run-vitest.mjs <file> --maxWorkers=1(thepnpm testentrypoint). Measured before the import-only rebase conflict resolution; affected proof was rerun on the rebased source. These isolated-file times include worker preparation; existing CI shards share that preparation. No new CI matrix or repeated-run lane is added. Hosted CI was cancelled after the inherited audit failure, so no completed hosted duration is claimed for these suites.src/cli/json-output-mode.test.tssrc/cli/plugin-registry-loader.test.tssrc/cli/secrets-store-input.test.tssrc/cli/update-cli/update-command-doctor-authority-callers.test.tssrc/cli/update-cli/update-command-lifecycle.test.tssrc/commands/doctor-update-schema-guard.test.tssrc/commands/doctor/shared/legacy-mistral-model-cost.test.tssrc/commands/doctor/shared/plugin-runtime-symlinks.test.tsNo UI, manifest, public SDK, config-schema, persisted-format, or wire-format change. No dependency or generated-asset change.