Repository navigation
refactor: remove unused CLI and infrastructure arguments - #178163
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. |
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: needs maintainer review before merge. What this changesThis PR removes unused internal arguments and status fields, uses existing runtime dependencies directly, and adapts the affected tests. Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete 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 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherCLI 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
Technical reviewBest 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
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource -199, Tests +41. Total -158 across 63 files. Added test files: 0. View PR surface stats
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 HistoryReview history (1 earlier review cycle)
Reviewed October 20, 2026, 3:21 AM ET / 07:21 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
5261881 to
0c2a2be
Compare
|
Merged via squash.
|
…8163) * refactor: remove unused CLI and infrastructure arguments * test(status): remove obsolete overview fixture fields
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)` 分岐は本コミットが既に削除済みで、重複は残っていない。
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
526188198b31completed 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 head0c2a2be5bd49passes 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.