Skip to content

refactor(cli): keep private operations with their command owners - #178567

Merged
steipete merged 1 commit into
mainfrom
deslop/z25-64-cli-private-followthrough-20261015
Oct 20, 2026
Merged

steipete merged 1 commit into
mainfrom
deslop/z25-64-cli-private-followthrough-20261015

Conversation

@steipete

@steipete steipete commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Several internal CLI operations have a separate exported module or forwarding function despite having only one production consumer.

User Impact

No user-visible change. CLI commands, options, output, authorization checks, lazy imports, and temporary-resource cleanup remain unchanged.

What Changed

Keep capability registration, Claw preview preparation/output, personal model-account registration, private-QA loading, DNS setup, telemetry output, and metadata projections with their existing callers. Use the canonical Gateway path resolver instead of its one-use alias. Migrate affected tests through registration and public command owners rather than retaining test-only production exports.

This is the CLI area of an 83-path owner-consolidation family, split by area to keep CI attribution bounded. Strict production delta: 314 additions / 396 deletions, 82 net lines removed. Test and baseline changes are excluded from that count.

Best-effort tradeoffs accepted

None: no defensive guard or supported behavior is removed. Dynamic runtime/domain imports, personal-account scope refusal, option inheritance, sanitization, and disposal-before-output/error handling are preserved.

Evidence

  • Focused capability, Claws, argv/policy, help/registration, models/accounts, telemetry, DNS, authoring, and private-QA suites passed serially with one worker and isolated application state. The root-help repair passed all five cases.
  • Targeted native typechecks, typed lint, format, line-cap, assertion-safety, mock-export, and wrapper import-closure checks passed. Independent review of the complete family found no actionable P0–P2 issues.
  • The conflict rebase retains main's removal of Claws runtime DI parameters and composes it with the private preparation/output folds. Both temporary resources remain inside the existing try block and dispose before output/error handling. The other CLI hunks are patch-identical to the independently reviewed family. Focused conflict proof passed all 25 Claws public-command/state cases and 14 suppression-audit cases, plus targeted native types, typed lint, formatting, and line-cap checks. Hosted CI on the replacement head is the broad gate; prior-head CI is not replacement-head proof.
  • Replacement conflict-proof assertion-safety and mock-export checks passed; runtime cycles and Madge cycles were both zero.

No local build, broad suite, whole-graph typecheck, or live operator-state command was run.

Inherited CI exception

Exact-head CI39465970388 attempt1 fails the unrelated UI widget-scroll and cold-load-anchor assertions plus their downstream ci-gate; all other selected jobs and security-fast pass. Automatic rows say new against older passing scheduled-main shards, not matching signatures. The actual tested merge's3687-module runtime closure (both tests plus served UI) has zero unresolved local imports, reaches none of the24 changed PR paths, and is unchanged from the actual main parent. Both exact cases also fail on independent provider head20b4 in CI39466733944. The coordinator flake ledger and last six completed scheduled runs were checked. No local E2E replay is claimed. Landing uses the campaign-authorized native inherited-only exception under rule8, with the complete failure table and actual-checkout/source evidence in the landing comment; failed CI is not described as green.

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 20, 2026
@clawsweeper

clawsweeper Bot commented Oct 20, 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.

@steipete
steipete marked this pull request as ready for review October 20, 2026 16:49
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T17:28:39.970193Z 56c91f4 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: L labels Oct 20, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 Oct 20, 2026
@clawsweeper

clawsweeper Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR moves private CLI operations into their existing command owners and removes superseded helpers and exports.

Example: Run openclaw models --json accounts list --port 19002.

  • Before: A separate account registrar handles the command and inherited options.
  • After: The models registrar handles the same command and options directly, preserving its output and account scope.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is coherent and source-equivalent across the moved operations, with reported focused validation and harness coverage; shipped-entry-point proof is not supplied.
Proof confidence 🦐 gold shrimp (3/6) The ordinary contributor proof gate is waived for this maintainer-authored refactor; no authority-bearing value or authorization boundary materially changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-authored direction reduces private forwarding surfaces without adding another owner, configuration option, or public contract.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it is a useful maintainer-directed consolidation, and the reviewed diff introduces no actionable correctness or security defect.

Priority: P3
Reviewed head: e3e36ac9fe7cc6703281d2128d8596151b6edc6f

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No shipped CLI execution is supplied; the reported validation exercises command-owner suites, including the Claw artifact lifecycle harness.
Agent review details

How this fits together

The CLI parses arguments, selects startup policy, lazily registers command implementations, and dispatches operations that produce terminal output or invoke existing runtime owners.

flowchart TD
A[CLI arguments] --> B[Argument and startup policy]
B --> C[Command descriptors]
C --> D[Command registration]
D --> E[Existing runtime owners]
E --> F[Output and cleanup]
Loading

Technical review

Best possible solution:

Keep the consolidation within existing command owners while preserving command contracts, lazy loading, scope checks, and resource disposal.

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

This is a behavior-preserving refactor rather than a reported product bug; source comparison supports its premise, and no target code was executed during this read-only review.

Is this the best way to solve the issue?

The patch follows existing ownership boundaries, removes the replaced paths, and retains shared helpers where multiple callers still need them.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 5c1432f10bba.

Provenance checked

  • Inference registration keeps the original intent (2175a15: Load only the selected inference domain while keeping metadata commands lightweight and fallback help complete.)
  • Claw project preparation and output keeps the original intent (7422222: Provide a local author lifecycle using verified immutable artifacts and offline previews; later output consolidation centralized diagnostics.)
  • Personal account registration keeps the original intent (e4e2305: Keep personal provider accounts attached to the signed-in Gateway person rather than an agent.)
  • Private QA loading keeps the original intent (d5933af: Resolve private QA artifacts correctly from source checkouts while retaining explicit availability restrictions.)
  • Gateway argument parsing and help metadata keeps the original intent (df521a6: Preserve shared startup selection and consume required option values before interpreting destructive flags; the removed catalog resolver only forwarded to the retained resolver.)
  • DNS setup keeps the original intent (f32242e: Bound the Homebrew prefix probe without imposing that deadline on installation, privileged writes, or restart.)
  • Telemetry preview keeps the original intent (3a16070: Show no planned request when telemetry is suppressed in automation or update checks are disabled.)
  • Plugin authoring metadata keeps the original intent (68b932a: Preserve authored plugin declarations while deriving publication metadata through the canonical manifest owner.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned introduction: Reviewed the introduced patch from the verified merge base to the original head, including both deleted modules and their replacement callers. (e3e36ac9fe7c)
  • Account boundary preserved: The relocated account dispatcher still rejects agent scope before loading account commands and preserves parent-option inheritance and explicit leaf overrides; existing registration tests cover these contracts. (src/cli/models-cli.ts:205, e3e36ac9fe7c)
  • Cleanup and loading contracts preserved: Claw temporary resources remain scoped inside the preparation try block, before output; inference domain imports remain lazy, and private QA retains its explicit opt-in and source-checkout checks. (src/cli/claws-cli.project.ts:156, e3e36ac9fe7c)
  • Current main context: The fetched main retains the pre-refactor CLI implementations, so this consolidation remains distinct work. (src/cli, 5c1432f10bba)
  • Discussion and validation: The full PR body and comments supply focused-suite and static-check results, with no additional behavioral artifact; the exact-head CI gate remains pending and GitHub reports the PR mergeable. (e3e36ac9fe7c)
  • Repository policy and clean checkout: Read the complete root guidance; no ancestor guidance exists under the touched CLI or config paths, and the maintainer-notes directory is absent; the checkout remained clean. (AGENTS.md, e3e36ac9fe7c)

Likely related people:

  • Peter Steinberger: Raw commit 6a9d3f1 adds src/cli/claws-cli.project.ts:54 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 6a9d3f1be365; files: src/cli/claws-cli.project.ts)
  • Gio Della-Libera: Raw commit 7422222 adds src/cli/claws-cli.project.ts:35 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 7422222788c4; files: src/cli/claws-cli.project.ts)

PR surface

Source -82, Tests +30, Other -1. Total -53 across 24 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 17 314 396 -82
Tests 6 58 28 +30
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 24 372 425 -53

Labels

Label changes:

  • add P3: This is internal maintenance with no intended user-visible behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is internal maintenance with no intended user-visible behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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.

Reviewed October 20, 2026, 1:07 PM ET / 17:07 UTC.

@steipete
steipete force-pushed the deslop/z25-64-cli-private-followthrough-20261015 branch from e3e36ac to 56c91f4 Compare October 20, 2026 17:25
@steipete

Copy link
Copy Markdown
Contributor Author

Exact-head inherited-failure evidence for 56c91f4481f978b4100cc57a835e9af9878d733a, CI39465970388 attempt1:

Failed job Attribution
UI1/9 /118778072906 chat-widget-scroll.e2e.test.ts: touch-fling continuity/reader preservation assertion. Actual tested-merge runtime closure, including the served UI entry point, reaches none of the24 changed PR paths. The complete closure is unchanged from the actual main parent. Inherited by construction under campaign rule8.
UI4/9 /118778072695 chat-cold-load-anchor.e2e.test.ts: cached-tail/title/reply/progress-before-hello assertion. Same unchanged actual-main runtime closure; no CLI source or baseline in the PR can execute through this mocked-Gateway UI flow. Inherited by construction.
ci-gate /118793675953 Downstream of those two UI leaves. All other selected jobs and security-fast pass. Every exact-head check run and attempt job was enumerated. One cancelled context/evidence job has a successful same-head counterpart; no runtime suite is missing proof.

The checkout log attests merge 638df62af159593dd86c42cbed6be7e0dec41b48 with ordered parents f20c3c758bb651a236a774a4c3f66e5fbe06f63d and this exact PR head. Its tree 330fbde876935d59203306bbb9fea34dac494e82 equals an independently derived merge, including the complete PR change. Native AST analysis reads those Git objects directly:3687 repository runtime modules, zero unresolved local imports, zero changed PR paths reachable, and zero source differences in that closure between actual main parent and tested merge. Erased type-only imports are not runtime edges; the five pinned external npm packages and non-code assets do not change.

The automatic table says new relative to older passing scheduled-main shards and does not compare scopes. The coordinator flake ledger and latest six completed scheduled runs were checked; no matching-signature attribution or passing local replay is claimed. Both exact UI cases also fail on the independent provider head 20b4f7bcbc4d92b602c399bba25e64b7aef00a9b in CI39466733944. The actual-main source/import-closure comparison supplies attribution; a local E2E replay is outside the host proof budget.

Proceeding through the authorized native inherited-only exception, subject to its pinned-head artifact, authority, review and security verification. This is not green CI. No rerun, synthetic push, timeout increase, skip, or hunk drop was used.

@steipete
steipete merged commit 5af1093 into main Oct 20, 2026
147 of 152 checks passed
@steipete
steipete deleted the deslop/z25-64-cli-private-followthrough-20261015 branch October 20, 2026 18:07
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:full Keep ordinary native-locale CI selection on the next PR run. cli CLI command changes P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: L 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