Repository navigation
refactor(runtime): deslop remaining private knobs - #165330
Conversation
Specialize private runtime helpers to their actual callers and remove unused debug branches, timing options, and forwarding fields. Preserve documented configuration, public SDK contracts, migration writers, and lifecycle guards. The batch removes 352 net production lines after excluding other active lanes. Full environment-owner coverage and focused Linux/core/plugin/UI proof recorded for the below-threshold campaign closeout.
|
🦞👀 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. |
|
l379 environment-owner coverageFully READ 1,211 inventoried environment-reading modules over 200 lines (626,062 inventory lines), including root launchers and native Rust/Python/JavaScript owners. This is the cross-cutting environment-owner inventory, not a claim that every unrelated monorepo module was read. Named test/generated/script paths and reserved audit/cron trees were excluded from discovery; remaining test-infrastructure false positives are identified in row reasons. Counts refer to the read snapshot; changed owners/callers were subsequently reviewed and tested. Documented contracts and active-owner candidates were retained. Part 1/8, descending original size. READ coverage 1/8
|
l379 environment-owner coverageFully READ 1,211 inventoried environment-reading modules over 200 lines (626,062 inventory lines), including root launchers and native Rust/Python/JavaScript owners. This is the cross-cutting environment-owner inventory, not a claim that every unrelated monorepo module was read. Named test/generated/script paths and reserved audit/cron trees were excluded from discovery; remaining test-infrastructure false positives are identified in row reasons. Counts refer to the read snapshot; changed owners/callers were subsequently reviewed and tested. Documented contracts and active-owner candidates were retained. Part 2/8, descending original size. READ coverage 2/8
|
l379 environment-owner coverageFully READ 1,211 inventoried environment-reading modules over 200 lines (626,062 inventory lines), including root launchers and native Rust/Python/JavaScript owners. This is the cross-cutting environment-owner inventory, not a claim that every unrelated monorepo module was read. Named test/generated/script paths and reserved audit/cron trees were excluded from discovery; remaining test-infrastructure false positives are identified in row reasons. Counts refer to the read snapshot; changed owners/callers were subsequently reviewed and tested. Documented contracts and active-owner candidates were retained. Part 3/8, descending original size. READ coverage 3/8
|
l379 environment-owner coverageFully READ 1,211 inventoried environment-reading modules over 200 lines (626,062 inventory lines), including root launchers and native Rust/Python/JavaScript owners. This is the cross-cutting environment-owner inventory, not a claim that every unrelated monorepo module was read. Named test/generated/script paths and reserved audit/cron trees were excluded from discovery; remaining test-infrastructure false positives are identified in row reasons. Counts refer to the read snapshot; changed owners/callers were subsequently reviewed and tested. Documented contracts and active-owner candidates were retained. Part 4/8, descending original size. READ coverage 4/8
|
l379 environment-owner coverageFully READ 1,211 inventoried environment-reading modules over 200 lines (626,062 inventory lines), including root launchers and native Rust/Python/JavaScript owners. This is the cross-cutting environment-owner inventory, not a claim that every unrelated monorepo module was read. Named test/generated/script paths and reserved audit/cron trees were excluded from discovery; remaining test-infrastructure false positives are identified in row reasons. Counts refer to the read snapshot; changed owners/callers were subsequently reviewed and tested. Documented contracts and active-owner candidates were retained. Part 5/8, descending original size. READ coverage 5/8
|
l379 environment-owner coverageFully READ 1,211 inventoried environment-reading modules over 200 lines (626,062 inventory lines), including root launchers and native Rust/Python/JavaScript owners. This is the cross-cutting environment-owner inventory, not a claim that every unrelated monorepo module was read. Named test/generated/script paths and reserved audit/cron trees were excluded from discovery; remaining test-infrastructure false positives are identified in row reasons. Counts refer to the read snapshot; changed owners/callers were subsequently reviewed and tested. Documented contracts and active-owner candidates were retained. Part 6/8, descending original size. READ coverage 6/8
|
l379 environment-owner coverageFully READ 1,211 inventoried environment-reading modules over 200 lines (626,062 inventory lines), including root launchers and native Rust/Python/JavaScript owners. This is the cross-cutting environment-owner inventory, not a claim that every unrelated monorepo module was read. Named test/generated/script paths and reserved audit/cron trees were excluded from discovery; remaining test-infrastructure false positives are identified in row reasons. Counts refer to the read snapshot; changed owners/callers were subsequently reviewed and tested. Documented contracts and active-owner candidates were retained. Part 7/8, descending original size. READ coverage 7/8
|
l379 environment-owner coverageFully READ 1,211 inventoried environment-reading modules over 200 lines (626,062 inventory lines), including root launchers and native Rust/Python/JavaScript owners. This is the cross-cutting environment-owner inventory, not a claim that every unrelated monorepo module was read. Named test/generated/script paths and reserved audit/cron trees were excluded from discovery; remaining test-infrastructure false positives are identified in row reasons. Counts refer to the read snapshot; changed owners/callers were subsequently reviewed and tested. Documented contracts and active-owner candidates were retained. Part 8/8, descending original size. READ coverage 8/8
|
|
Codex review: needs real behavior proof before merge. Reviewed October 5, 2026, 1:22 AM ET / 05:22 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch removes private runtime options, debug switches, and forwarding helpers across channel plugins, agent execution, plugin loading, CLI commands, and the Control UI. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 7 items remain The useful cleanup remains distinct from the related merged work, but the prior Slack authorization finding is still unresolved. The lint corrections do not address it. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s runtime helpers translate configuration and incoming events into agent execution, transport requests, and UI presentation. Slack’s membership helper also decides whether another bot may trigger a turn based on an explicit owner’s presence. flowchart TD
A[Configuration and incoming events] --> B[Private runtime helpers]
B --> C[Channel access decisions]
C --> D[Agent execution]
B --> E[Transport requests]
D --> F[Replies and UI presentation]
E --> F
Before merge
Findings
Agent review detailsSecurityNeeds attention: The Slack cut changes authorization freshness for existing installations; no dependency or supply-chain change was found. PR surfaceSource -354, Tests -186, Other 0. Total -540 across 74 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the released Slack TTL override while simplifying genuinely fixed private paths, with transport and authorization proof scoped to any retained behavior changes. Do we have a high-confidence way to reproduce the issue? Yes, from source: set the released Slack TTL override to zero, authorize an eligible unlisted bot while an owner is present, remove that owner, and authorize again within 60 seconds using the same context. The proposed code reuses the first membership result; no runtime reproduction was executed. Is this the best way to solve the issue? No for the Slack cut: an environment-selected authorization freshness control is not a fixed private option. Preserve it or separate its intentional removal from the behavior-preserving cleanup. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e693ea0a11bc. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
The six-hour lane timebox has elapsed. This PR is not ready to merge yet: exact-head hosted CI found two attributable lint errors:
The two mechanical corrections are prepared locally (rename the fixture variable and remove the stale directive), but are not validated, committed, or pushed. Auto-merge is being disabled pending that follow-through. The 4,374 passing runtime tests, production typechecks, zero-cycle results, and independent review remain evidence for the published candidate; they do not override these lint failures. No inherited-main exception is claimed. |
* refactor(runtime): deslop remaining private knobs Specialize private runtime helpers to their actual callers and remove unused debug branches, timing options, and forwarding fields. Preserve documented configuration, public SDK contracts, migration writers, and lifecycle guards. The batch removes 352 net production lines after excluding other active lanes. Full environment-owner coverage and focused Linux/core/plugin/UI proof recorded for the below-threshold campaign closeout. * fix: resolve private knob cleanup lint errors
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
Private runtime helpers still carry switches, option forwarding, and alternate branches that their production callers never select.
User Impact
Normal user behavior, documented environment/configuration/CLI settings, public SDK APIs, protocol shapes, and lifecycle authority remain unchanged. Unsupported pre-Node-22 Telegram branches are removed within the current Node support floor.
Why This Change Was Made
BELOW-1000: 354 net production lines removed. The full defined environment-owner coverage log is attached in numbered comments: 1,211 modules over 200 lines, 626,062 inventory lines, every entry marked READ with a disposition and reason. This is one final batch; no intermediate pushes. Named SDK compatibility, July-and-later migration writers, and other active lanes remain untouched. Overlaps with #165198, #165225, and #165236 were excluded before publication.
Evidence
pnpm tsgo:prodpassed for core, UI, and extensions.tbx_01m456avxd5zsa23sj2cef1vjc, both touched-file lint commands passed with zero warnings/errors, and both import-cycle checks reported zero. The wrapper verified the exact source tree and both correction hashes; the remote command exited 0 in 3m33s. The lease was stopped after proof.Fixes Found Along the Way
A
system.whichdefect was reproduced and fixed in a separate retained patch: directories/non-executable Unix files were reported as commands, and explicitly suffixed Windows executables were missed. The regression failed on the original implementation and passed through the canonical executable resolver. That change is excluded here and remains with the type-mirror lane owner; the self-contained repair and regression test are preserved for that owner.