Skip to content

refactor: remove unused CLI and infrastructure arguments - #178163

Merged
steipete merged 2 commits into
mainfrom
deslop/z28-28-infra-cli-area-20261015
Oct 20, 2026
Merged

steipete merged 2 commits into
mainfrom
deslop/z28-28-infra-cli-area-20261015

Conversation

@steipete

@steipete steipete commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Internal CLI and infrastructure helpers expose alternate arguments that production callers never use, obscuring the actual runtime path.

User Impact

No intended user-visible change. Existing CLI flags, config, Plugin SDK contracts, network budgets, restart blockers and output stay intact.

Why This Change Was Made

Use the existing process, filesystem, command, fetch and clock owners directly instead of merging test-only dependency bags. Inline the sole live values for private provider, startup, diagnostic and formatting arguments; remove unread internal status projections. Tests use scoped module/global spies while retaining behavior assertions.

This is the infrastructure/CLI area slice of the wider argument-cleanup family. It is deliberately split from agent execution/auth/admission to keep CI attribution bounded, under the campaign's wide-family sizing exception.

Best-effort tradeoffs accepted

No speculative timing or security guard is removed in this slice. Removed alternatives have no production callers; tests now exercise the same canonical dependency path as production. Runtime/platform/error handling and real cancellation, startup settlement and restart checks remain.

Size

63 paths, 200 net production lines removed (106 added / 306 removed); 41 test/support lines added. Excludes tests, fixtures, generated files and declarations from production counts.

Evidence

Whole-tree caller and public-export searches include src, extensions, ui/src, packages and scripts. Introducing history and open activation work were checked per family; real incident repairs remain in place (including the child-runtime mitigation from #157190 and banner startup settlement from #105774).

Focused native types, typed lint, formatting and owner/caller tests passed for the individual packets. The latest argument packet passed 515 focused behavioral tests across 31 files, runtime/static cycles (both zero) and 14 suppression tests; unchanged-input results are retained rather than rerun.

Fresh area integration passed: native types with 62 explicit roots, core typed lint, extension syntax lint, formatting, four status suites (44 cases, 434.26 seconds including worker preparation), runtime/static cycles (both zero), and the mandatory suppression audit (14 cases, 37.06 seconds). Independent cumulative review found no actionable P0-P2 findings. Author simplification/test audit completed; tests retain platform/error/cancellation behavior, and mock migration adds fewer lines than production removes.

The first hosted run (39381317324) found one missed test consumer: the Gateway health fixture still supplied the two removed overview-result fields. The fixture now omits those properties without changing any case or assertion. Expanded targeted native types, fixture typed lint, formatting and whitespace checks pass; the focused health suite passes all 20 cases (621.01 seconds), and the suppression audit passes all 14 cases (49.02 seconds). Independent repair review found no actionable P0-P2 findings. The original head's two extension lint jobs passed, covering the source-only checkout's generated-SDK lint limitation. Remaining checks bind to the repaired head; prior-head CI is not claimed as current-head success.

Repaired head 526188198b31 completed broad CI run 39383616398 without a failing suite. GitHub subsequently reported a conflict with main's removal of redundant diagnostic-history copies. The conflict-only rebase retains that main simplification alongside the fixed six-entry history and attribution-time filter; the remaining authored patches are unchanged. Rebased head 0c2a2be5bd49 passes targeted native types, typed lint, formatting, all 71 diagnostic cases across three suites, runtime/static cycles (both zero), the suppression audit (14 cases), and whitespace checks. Prior-head CI is not current-head proof. Cancelled auxiliary PR-context/ClawSweeper workflow checks are recorded separately from the completed broad suites.

@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.

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord gateway Gateway runtime cli CLI command changes commands Command implementations extensions: inworld Extension: inworld extensions: vydra size: XL labels Oct 20, 2026
@steipete
steipete marked this pull request as ready for review October 20, 2026 06:35
@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-20T07:57:27.246811Z 0c2a2be 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.

@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: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. 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 removes unused internal arguments and status fields, uses existing runtime dependencies directly, and adapts the affected tests.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful simplification with no actionable finding; validation is supported by source, adapted owner tests, and reported focused runs rather than new end-to-end evidence.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor proof gate; supplied validation reports exercise affected owners and consumers, but no new shipped-entry-point run was independently performed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: There is no intended user-visible change; unused internal alternatives obscure the production path and increase maintenance cost.
Reason: The maintainer-authored direction is established, and the inspected cleanup reduces private surface area while preserving active caller behavior and public contracts.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-directed cleanup preserves the inspected production behavior, and no actionable code or security defect was found; the follow-up commit fixes the obsolete health fixture.

Priority: P3
Reviewed head: 526188198b3193d50c19297875867a1b62c8786d

Before merge

None.

Findings

None.

Agent review details

How this fits together

CLI startup, diagnostics, maintenance, and bundled provider helpers consume process state and existing runtime owners to produce command output, health facts, and network operations.

flowchart TD
A[CLI and Gateway callers] --> B[Internal helpers]
C[Bundled providers] --> B
B --> D[Process and filesystem owners]
B --> E[Guarded network owners]
D --> F[Output and diagnostic facts]
E --> F
Loading

Technical review

Best possible solution:

Retain the focused removal of unused internal alternatives while preserving existing runtime owners and public contracts.

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

This is a behavior-preserving refactor rather than a bug report; source and caller inspection support the unused-argument premise, and no target code was executed.

Is this the best way to solve the issue?

The change uses existing owners, removes superseded internal alternatives, and adapts meaningful platform, cancellation, recovery, and ordering coverage without adding a parallel implementation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 29587f5d95cf.

Provenance checked

  • CLI bootstrap orchestration keeps the original intent (20d30ac: Consolidate startup orchestration while preserving configuration-before-plugin ordering and captured policy semantics; the removed explicit skip value occurs inside the existing skip-policy branch.)
  • Banner animation and startup settlement keeps the original intent (55067fd: Prevent decorative animation from delaying useful Gateway startup while restoring terminal state before subsequent output.)
  • Safe restart coordination keeps the original intent (103cdd9: Defer restarts around tracked active work; the cleanup removes injected inspectors while retaining canonical counters and scheduling behavior.)
  • Managed npm host preservation keeps the original intent (89a9b4e: Preserve active host packages and symlinks during managed-peer repair; the same host classification and cleanup branches remain.)
  • Telemetry keeps the original intent (4d617f4: Provide daily update checks and opt-in anonymous feature reporting; all production update callers already identify the Gateway surface.)
  • Recent diagnostic phase attribution keeps the original intent (40b0b3d: Exclude historical phases outside the measured liveness interval without evicting long-running active phases.)
  • Child-runtime viability keeps the original intent (92c86fe: Diagnose a running Gateway whose Node executable disappeared after an upgrade; direct filesystem checks retain that diagnosis and later recovery handling.)
  • Tailscale boot readiness keeps the original intent (91669d0: Wait through transient daemon startup before route claiming while retaining bounded waiting and authoritative settled failures.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source -199, Tests +41. Total -158 across 63 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 34 107 306 -199
Tests 29 318 277 +41
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 63 425 583 -158

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P3: This is internal cleanup with no intended user-visible behavior change or demonstrated urgent regression.
  • 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-20T06:54:08.741Z sha bfe226c :: needs changes before merge. :: none

Reviewed October 20, 2026, 3:21 AM ET / 07:21 UTC (Revision 2).

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 20, 2026
@steipete
steipete force-pushed the deslop/z28-28-infra-cli-area-20261015 branch from 5261881 to 0c2a2be Compare October 20, 2026 07:53
@steipete
steipete merged commit 8b680f3 into main Oct 20, 2026
152 of 153 checks passed
@steipete
steipete deleted the deslop/z28-28-infra-cli-area-20261015 branch October 20, 2026 08:23
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 21, 2026
…8163)

* refactor: remove unused CLI and infrastructure arguments

* test(status): remove obsolete overview fixture fields
NEXTAltair added a commit to NEXTAltair/openclaw that referenced this pull request Nov 10, 2026
rebase 時のコンフリクト解決 (onto 92635da, 元コミット 119f95fdaa6):
- 上流 openclaw#143905/openclaw#147242 で safe RPC restart 分岐に
  assertGatewayServiceFallbackAllowed("safe RPC restart") が追加された。
  本コミットは safe 分岐を external-supervisor 判定より前へ移し暗黙 safe 判定を
  足しているため、移動先の分岐に上流のガードを取り込み、旧位置の重複分岐は削除

rebase 時のコンフリクト解決 (onto 57fd13e, 元コミット 21f40bf994c):
- 上流 8b680f3 (openclaw#178163) が createSafeGatewayRestartPreflight の
  inspectors 引数と SafeRestartInspectors 型を削除。引数なしの形に合わせ、
  session admission / mutation を 0 に固定するスタブだけを外して実数で数える
- 上流 c268b9d (openclaw#181608) が SafeRestartTarget 型を引数へインライン化。
  インライン型のまま transport 引数を追加
- 上流がテストを describe なしのトップレベル it と、実モジュールの spy による
  カウンタ差し替えに書き直したため、両テストファイルは上流版を基に
  本コミットのケースを追加。restart-coordinator.test.ts は
  session-controller.lifecycle.js を spy して admitted turn を 1 件にする

rebase 時の調整 (onto 258d034, 元コミット 76c4af4b6cc):
- restart-suspension.test.ts: 上流 36e277d (openclaw#175837) が
  session-lifecycle-admission.js を session controller へ統合して削除し、
  上流 f27df1d (openclaw#165330) が scheduleGatewayRestart の skipCooldown を
  削除していた。どちらも前回のベース (57fd13e) より前の変更で、
  このファイルは読み込みに失敗し上流分を含む全テストが動いていなかった。
  後継の beginSessionEffect / getSessionControllerWorkCount
  (session-controller.lifecycle.js) へ置き換え、skipCooldown を外した。
  クールダウンは直前に再起動を発信した場合だけ掛かるため、外しても挙動は同じ

rebase 時のコンフリクト解決 (onto 638a185, 元コミット a06162363f5):
- 上流が lifecycle-safe-restart.ts に restartFlagConflictError / assertNativeRestartFlags
  を追加し、runDaemonRestart の冒頭で呼ぶ形にした (--preserve-definition と --safe、
  --skip-deferral の組み合わせ検査)。上流の2関数と呼び出しを残したまま
  shouldUseImplicitSafeRestart と requestSafeGatewayRestartIfNeeded の呼び出しを
  その直後に並べた (フラグ検査 → 暗黙 safe 判定 → external-supervisor の順)。
  旧位置の `if (opts.safe)` 分岐は本コミットが既に削除済みで、重複は残っていない。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord cli CLI command changes commands Command implementations extensions: inworld Extension: inworld extensions: vydra gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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