Repository navigation
refactor: consolidate command, CLI, cron, and channel paths - #173036
Conversation
Keep one sub-CLI metadata/registration catalog, common cron payload updates, canonical agent migration visitors, and shared account-state projection. Trust typed internal adapters while retaining external validation, effect authority, cancellation settlement, supported migrations and path containment. Wave-5 y10: BELOW-500, 353 net production lines removed (+440/-793 in 19 files). Branch-only handoff for the coordinator's bundle; no standalone PR. Best-effort tradeoffs accepted: - Cron mid-setup reload recovery (#146582): synthetic retirement, no human incident. Setup may fail; the next invocation refreshes the cache. - Recursive shared preparation retry (#102494/#138337): synthetic concurrent callers; production serializes same-job work. Duplicate direct callers may share cancellation. Failed-owner eviction preserves the next sequential run. - Progress publication generation (#143621): synthetic held update/reset. Presentation dedupe may briefly be stale until a subsequent render/reset. - Doctor adapter schema mirror (#69919): malformed synthetic hooks. Invalid executable adapters fail visibly; missing-hook fallbacks and config checks stay. - Setup adapter schema mirror (#165492): typed internal union. Invalid internal adapters fail when used; both supported wizard forms remain. - Injected process schema mirror (#84381): malformed injection was not human SIGTERM report #71710. Invalid adapters fail registration; cancellation stays. - Loaded registry row revalidation/copy (#114942/#158830/#114476): rows already admitted/normalized. Corrupt trusted rows can fail; first-wins authority stays. - Custom compatibility duplicate check (#14223): all callers parse/type it. Hand-crafted invalid JS uses the default branch; external flags still reject it. - Log probe identity matching (#88159, superseded by #168587): abort now joins the sole probe, so replacement cannot race its result. Recovery/settlement stay. - Whole-config deep copy (#71218): no detached-copy incident. Structural copy updates agents/defaults; unrelated future mutation must respect config ownership. - Repeated plugin-root probes (#70012): no disappearing-root incident. Resolve roots once; root replacement can fail discovery. Symlink containment stays. - Second payload getter read (#135319): synthetic review/corpus, not a human report. Ordinary decoded records are read once; stateful accessors may differ. Proof: fresh independent review clean; core types, targeted lint/format, runtime and static cycles, assertion/line-cap ratchets, and suppression suite passed. Focused CLI cohort: 8 files / 41 tests passed. Earlier unchanged account/setup and cold-import checks passed. Cron and commands cohorts were interrupted after partial results; complete owner tests, payload merging, test-graph types, broad check-changed and build/smoke remain unproved at commit preparation. Unattributed local 120-second timeouts retained: two root-command-descriptions catalog cases and agent-via-gateway's Gateway attempt-budget case. No timeout, retry, skip or kept-behavior expectation changes. Env-name budget mismatch (455 vs 454) also exists at original HEAD and pinned main 7dccff5. All runtime proof used isolated HOME/OpenClaw/XDG state; Phase E untouched.
Share daemon and cron method forwarding through the existing lazy binder, remove the cron CLI reexport shim, and consolidate normalization and merge handling without changing public fields, explicit clears, or effect authority. Remove the obsolete bundled discovery reentry mechanism and impossible Doctor issue helper. The full lane now removes 475 net production lines. Best-effort tradeoffs accepted: - Unknown Doctor issue variants supplied by hand-crafted JavaScript return the invalid value rather than a custom error. Typed local producers and exhaustive switches remain; reporting feature #95979 cites no human unknown-kind incident. - Synchronous bundled-module self-discovery may fail through the existing loader diagnostic instead of returning empty inventory. Commit 65f18d6 only pins injected Jiti reentry, not a human incident; ordinary caches remain. - Cron defaults trust staggerMs normalized earlier in the same synchronous call. No await or mutation boundary intervenes; externally supplied invalid values remain rejected by the normalizer.
|
🦞👀 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. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: blocked before merge. What this changesThis PR consolidates CLI registration, cron payload handling, channel adapters, and Doctor migration helpers while removing redundant internal checks. Example: A cron job changes from a command payload to a script payload with timeoutSeconds set to 30.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 3 items remain Keep this maintainer-directed refactor open; the consolidation is useful, but deleted test coverage leaves stale ratchet entries that fail required CI. Priority: P3 Before merge
Findings
Tests
Agent review detailsHow this fits togetherCLI commands and scheduled jobs enter shared registration, configuration, and execution owners, which produce command output, repaired configuration, channel status, and guarded tool effects. flowchart TD
A[User commands] --> B[CLI catalog]
B --> C[Command owners]
C --> D[Doctor config repairs]
C --> E[Channel registry]
F[Cron payload owner] --> G[Run admission]
G --> H[Guarded tool effects]
Technical reviewBest possible solution: Keep the shared owners, remove obsolete cache state and ratchet allowances, and verify existing-install preservation through Doctor. Do we have a high-confidence way to reproduce the issue? No underlying product bug is claimed; source inspection and exact-head CI annotations establish the stale-baseline defect without executing target code. Is this the best way to solve the issue? The consolidation fits the existing owners and documented trust boundary, and the maintainer explicitly accepts the narrower best-effort lifecycle behavior. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b1dc7eff4d71. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource -475, Tests -171, Other -2. Total -648 across 40 files. Added test files: 2. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 15, 2026, 6:49 AM ET / 10:49 UTC. |
Withdraw the progress compositor generation removal after the Mattermost retiring-publication case failed CI and bounded serial head/base replays remained inconclusive under load. Restore that file exactly to the branch base and keep all Mattermost tests unchanged, following the campaign fallback. Prune the single obsolete mock-export allowance left by the removed bundled discovery reentry fixture. The local mock ratchet passes with 9586 factories. The remaining lane reduction is 471 net production lines across 25 paths.
|
Final disposition for head The exact-head CI run 38724998058 completed successfully, with 61 passing jobs including The review of the prior head raised two additional cleanup items. The stale bundled-test max-lines allowance is real, but the claim that it blocks hosted CI is incorrect: No persisted shape, schema, config contract, or supported migration was removed. Canonical and legacy agent-roster migration coverage remains. A full latest-stable upgrade was not run; that gap and incomplete local cohorts remain disclosed in the PR. The generic upgrade request identifies no concrete incompatible data transformation, so it does not expand this scoped refactor into a release-validation campaign. The two cancelled control jobs are superseded on this same head: PR context/evidence run 38724994476 by successful 38725013859, and dispatch run 38724994239 by successful 38725013995. They are not cancelled test suites or inherited-red claims. CodeQL concluded neutral. No inherited-failure admin exception is needed. |
|
Merged via squash.
|
#173036 consolidated typed payload merging while retaining authored-input validation. The persistence fixture injected env:null through an as-never cast and expected the typed service to reject it after the conversion. Exercise normalizeCronJobPatch, the owner used by Gateway cron.update, for that malformed input instead. Keep every persisted payload, inherited tool allowlist and failed-edit non-mutation assertion. No production or authority behavior changes. Proof: adjacent parent passes and #173036 fails the original case; corrected normalization, merge and delivery-status cohort passes all 69 cases.
Keep actual catalog metadata and argv parsing while making unused lazy registrar imports fail-fast fixture modules. The single-catalog change in #173036 intentionally preserves lazy loading, but inline esbuild fixtures started bundling the unrelated command graph. That caused a duplicate createRequire declaration and pulled in ws's optional bufferutil import. Preserve the builtin-only dependency guard and every launcher, rollback, selector, cache, and worker assertion. Production update behavior is unchanged; the packaged bootstrap passes the same managed-update controls. Proof: both helper consumers pass in their owning configs (12 managed-node and 133 launcher cases). Unexpected registration fails explicitly. Targeted tooling/E2E types, typed lint, formatting and P2 review pass.
…#173036) * refactor: consolidate command and cron preparation paths Keep one sub-CLI metadata/registration catalog, common cron payload updates, canonical agent migration visitors, and shared account-state projection. Trust typed internal adapters while retaining external validation, effect authority, cancellation settlement, supported migrations and path containment. Wave-5 y10: BELOW-500, 353 net production lines removed (+440/-793 in 19 files). Branch-only handoff for the coordinator's bundle; no standalone PR. Best-effort tradeoffs accepted: - Cron mid-setup reload recovery (openclaw#146582): synthetic retirement, no human incident. Setup may fail; the next invocation refreshes the cache. - Recursive shared preparation retry (openclaw#102494/openclaw#138337): synthetic concurrent callers; production serializes same-job work. Duplicate direct callers may share cancellation. Failed-owner eviction preserves the next sequential run. - Progress publication generation (openclaw#143621): synthetic held update/reset. Presentation dedupe may briefly be stale until a subsequent render/reset. - Doctor adapter schema mirror (openclaw#69919): malformed synthetic hooks. Invalid executable adapters fail visibly; missing-hook fallbacks and config checks stay. - Setup adapter schema mirror (openclaw#165492): typed internal union. Invalid internal adapters fail when used; both supported wizard forms remain. - Injected process schema mirror (openclaw#84381): malformed injection was not human SIGTERM report openclaw#71710. Invalid adapters fail registration; cancellation stays. - Loaded registry row revalidation/copy (openclaw#114942/openclaw#158830/openclaw#114476): rows already admitted/normalized. Corrupt trusted rows can fail; first-wins authority stays. - Custom compatibility duplicate check (openclaw#14223): all callers parse/type it. Hand-crafted invalid JS uses the default branch; external flags still reject it. - Log probe identity matching (openclaw#88159, superseded by openclaw#168587): abort now joins the sole probe, so replacement cannot race its result. Recovery/settlement stay. - Whole-config deep copy (openclaw#71218): no detached-copy incident. Structural copy updates agents/defaults; unrelated future mutation must respect config ownership. - Repeated plugin-root probes (openclaw#70012): no disappearing-root incident. Resolve roots once; root replacement can fail discovery. Symlink containment stays. - Second payload getter read (openclaw#135319): synthetic review/corpus, not a human report. Ordinary decoded records are read once; stateful accessors may differ. Proof: fresh independent review clean; core types, targeted lint/format, runtime and static cycles, assertion/line-cap ratchets, and suppression suite passed. Focused CLI cohort: 8 files / 41 tests passed. Earlier unchanged account/setup and cold-import checks passed. Cron and commands cohorts were interrupted after partial results; complete owner tests, payload merging, test-graph types, broad check-changed and build/smoke remain unproved at commit preparation. Unattributed local 120-second timeouts retained: two root-command-descriptions catalog cases and agent-via-gateway's Gateway attempt-budget case. No timeout, retry, skip or kept-behavior expectation changes. Env-name budget mismatch (455 vs 454) also exists at original HEAD and pinned main 89f8219. All runtime proof used isolated HOME/OpenClaw/XDG state; Phase E untouched. * refactor: consolidate cron payload and lazy CLI paths Share daemon and cron method forwarding through the existing lazy binder, remove the cron CLI reexport shim, and consolidate normalization and merge handling without changing public fields, explicit clears, or effect authority. Remove the obsolete bundled discovery reentry mechanism and impossible Doctor issue helper. The full lane now removes 475 net production lines. Best-effort tradeoffs accepted: - Unknown Doctor issue variants supplied by hand-crafted JavaScript return the invalid value rather than a custom error. Typed local producers and exhaustive switches remain; reporting feature openclaw#95979 cites no human unknown-kind incident. - Synchronous bundled-module self-discovery may fail through the existing loader diagnostic instead of returning empty inventory. Commit ca10460 only pins injected Jiti reentry, not a human incident; ordinary caches remain. - Cron defaults trust staggerMs normalized earlier in the same synchronous call. No await or mutation boundary intervenes; externally supplied invalid values remain rejected by the normalizer. * fix(channels): retain replacement preview deduplication Withdraw the progress compositor generation removal after the Mattermost retiring-publication case failed CI and bounded serial head/base replays remained inconclusive under load. Restore that file exactly to the branch base and keep all Mattermost tests unchanged, following the campaign fallback. Prune the single obsolete mock-export allowance left by the removed bundled discovery reentry fixture. The local mock ratchet passes with 9586 factories. The remaining lane reduction is 471 net production lines across 25 paths.
openclaw#173036 consolidated typed payload merging while retaining authored-input validation. The persistence fixture injected env:null through an as-never cast and expected the typed service to reject it after the conversion. Exercise normalizeCronJobPatch, the owner used by Gateway cron.update, for that malformed input instead. Keep every persisted payload, inherited tool allowlist and failed-edit non-mutation assertion. No production or authority behavior changes. Proof: adjacent parent passes and openclaw#173036 fails the original case; corrected normalization, merge and delivery-status cohort passes all 69 cases.
Keep actual catalog metadata and argv parsing while making unused lazy registrar imports fail-fast fixture modules. The single-catalog change in openclaw#173036 intentionally preserves lazy loading, but inline esbuild fixtures started bundling the unrelated command graph. That caused a duplicate createRequire declaration and pulled in ws's optional bufferutil import. Preserve the builtin-only dependency guard and every launcher, rollback, selector, cache, and worker assertion. Production update behavior is unchanged; the packaged bootstrap passes the same managed-update controls. Proof: both helper consumers pass in their owning configs (12 managed-node and 133 launcher cases). Unexpected registration fails explicitly. Targeted tooling/E2E types, typed lint, formatting and P2 review pass.
What Problem This Solves
Commands, CLI registration, cron payload handling, and channel setup repeat internal validation and forwarding paths that obscure their actual owners.
User Impact
No intended user-visible feature change. CLI commands/flags/text, public SDK exports, supported migrations, persisted shapes, security effect checks, FIFO ordering, and shutdown settlement remain. No schema, durability, retention, permission, configuration, or dependency change.
Why This Change Was Made
Use one subcommand catalog and shared lazy method binder, one cron payload merge path, existing migration visitors, and boundary-validated internal adapters. Remove speculative lifecycle/reentry guards without weakening real admission or security effects. Preserve the measured lazy-loading boundaries.
Net production reduction: 471 lines across 25 paths (+537/-1008), excluding tests, fixtures, support, generated files, and declarations. The campaign coordinator explicitly waived the floor for this branch.
Coverage: recent three-day and fourteen-day history, then largest-file and sole-caller/dead-export sweeps across commands, CLI, cron, and channels. Retained credential/migration receipts, real service shutdown/restart authority, ingress durability/FIFO, versioned streaming/SDK contracts, measured caches, cron billing/session ownership, and future-slot repair justified by human report #77867. Phase E memory code is untouched.
Evidence
Best-effort tradeoffs accepted