Repository navigation
refactor(runtime): deslop unused internal options - #165198
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: blocked before merge. Reviewed October 5, 2026, 12:00 AM ET / 04:00 UTC (Revision 7). ClawSweeper reviewWhat this changesThe branch removes unused private runtime options, result fields, and forwarding helpers while adapting callers, tests, and provider documentation. Merge readiness⛔ Blocked before merge - 2 items remain Keep open: this remains useful, distinct cleanup, and the prior conflict and HTTP declaration blockers are resolved. No actionable introduced defect was found in the inspected changes. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s runtime assembles agent sessions, authorizes Gateway requests, and coordinates delivery, plugin installation, and updates. These private helpers carry prepared decisions between the owners that perform those operations. flowchart TD
A[Gateway requests and agent turns] --> B[Admission and prepared facts]
B --> C[Private runtime helpers]
C --> D[Agent session execution]
C --> E[Delivery and installation owners]
D --> F[Replies and recorded outcomes]
E --> F
Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep private decisions with their existing runtime owners while preserving public contracts, operator settings, and lifecycle checks. Do we have a high-confidence way to reproduce the issue? Not applicable: this is behavior-preserving cleanup, and no concrete introduced failure was established by source inspection. Is this the best way to solve the issue? Yes: specializing private helpers to their actual production callers removes competing bookkeeping without adding public capability or configuration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 592c0824ab7c. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
f28e9aa to
711b70e
Compare
Specialize private factories and option bags to their production callers, remove unread projections, and keep decisions with their existing owners. Preserve public SDK, configuration, protocol, persisted-data, and user-facing behavior.
1a17477 to
c7c0c3e
Compare
|
All remaining failures on the corrected head were independently reproduced on clean
Earlier disk-quota, temporary-directory-permission, and missing-runtime attempts are not attribution evidence. The successful setup and identical assertions above are the evidence. The full scheduled-main run also independently exhibits the X runtime-API inventory failure and the previously observed shared-state-broker failures: https://github.com/openclaw/openclaw/actions/runs/37253163652. The corrected source passed independent Codex review. Focused proof passed 512 tests, the portable worker suite passed all 18 tests, and the conflict integration passed all 34 tests in the dispatch ownership, incognito, and commentary-media suites. Both import checks reported zero cycles. Public configuration, protocol, and SDK signatures are unchanged. Net production reduction: 969 lines. Per Peter's explicit October 4 landing instruction, qualifying inherited failures remain recorded as failures; they are not relabeled green. Any admin squash request is pinned to the live API head SHA below. Reviewed and pushed head: Final exact-head CI 37260510094 has completed on Merged as |
Specialize private agent, Gateway, infrastructure, and plugin flows to their actual callers. Remove unused options, fixed-value forwarding, and unread result fields while preserving public SDK, configuration, protocol, and lifecycle contracts. Preserve the new commentary-media ownership hook during conflict integration. Net production reduction: 969 lines. Independent review was clean; focused owner tests passed and both import-cycle checks reported zero. Matching inherited main failures and exact-head CI evidence are recorded in PR openclaw#165198. Related prior batches: openclaw#164268, openclaw#164810, openclaw#165124.
Removing unused session-start options in #165198 left SessionStartEvent in an internal barrel after its final consumers were deleted. Remove only that re-export; preserve the underlying type and direct extension SDK export. The canonical dead-export scan fails on clean main and passes after this change. Core production typechecking and independent P2 review pass.
Removing unused session-start options in openclaw#165198 left SessionStartEvent in an internal barrel after its final consumers were deleted. Remove only that re-export; preserve the underlying type and direct extension SDK export. The canonical dead-export scan fails on clean main and passes after this change. Core production typechecking and independent P2 review pass.
What Problem This Solves
Runtime maintenance still requires tracing private options and result fields that no production caller varies or consumes, following #164268 and #164810. Overlapping cuts from #165124 have been retained on main and excluded from this PR's remaining line count.
User Impact
No user-visible change. Configuration keys, CLI output, persisted data, protocol fields, tool descriptions, and public plugin SDK signatures remain unchanged. This batch removes 969 net production lines across agents, Gateway, infrastructure, and private plugin/SDK implementation.
Why This Change Was Made
Specialize private flows to their actual callers and let the existing owner supply fixed facts. Each removal was checked against production callers, public barrels, dynamic loading, and the protected/concurrent-lane inventories.
Evidence
f28e9aaed72efa5d3551761cec3e1d56c7d10b95: agents, infrastructure, callers, the changed Gateway fixture, and both source-owned integration suites passed. Both import-cycle checks reported zero; plugin contracts passed.xplugin. Both import-cycle checks again reported zero. Plugin contracts: 1,139 tests passed, with only the matchingxruntime-API inventory failure also present on scheduled main run 37253163652.a2affcf76e937a769550b576c67cb6934642766c: afterOPENCLAW_BUILD_PRIVATE_QA=1 node scripts/prepare-vitest-runtime.mjs, the real-PTY local-chat case failed in 178 s with the sameSession MCP runtime scheduler has not been bound by its lifecycle ownererror seen on this branch. The TUI backend, local command owner, and MCP manager API are unchanged by this PR. Hetzner runrun_67c0da9feb1848216ad9b621c1b1551d. Earlier unprepared missing-module attempts are not used as attribution evidence.chat.senddeclaration and scope enforcement; no scanner rule or assertion is weakened. Corrected-head hosted CI is 37260510094, pinned toc7c0c3e742b7893dd80934250ed7c455fa2e8fba. The full batch and this correction each passed independent Codex review with no actionable P0–P2 findings.The conflict integration preserves main's inlined owners, the direct binding-or-null routing contract, the required usage-worker callbacks, and the retired private options. Public SDK/config/protocol shapes remain unchanged. No visual behavior changed.
Scheduled main at
b878998dbb198ed4f8d652111834d5912ea4ae4aalso reproduces the exact session-deletion/Doctor/BOOT cleanup failures (Shared-state admission requires the host broker). The unchanged causal path enters host-only receipt preparation from Vitest threads; it was introduced before this branch base. Main jobs: 111584949671, 111584949706, 111584949691. These are inherited failures, not passing checks.Final conflict integration preserves main's commentary-media ownership hook. Its 3 suites / 34 tests passed, both cycle checks returned zero, and two integrated review passes were clean. The portable worker suite passed all 18 tests (90 s wrapper wall time). Latest clean main
bb12da4399904b040cf7514d26fda7be198d4656reproduced the QA cleanup-message, X sidecar-baseline, and worker duplicate-assistant failures exactly; full attribution evidence. The owned Hetzner leasecbx_659ff6c82fc3is released with cleanup complete. Its fixed expiry interrupted the last optional contract replay; hosted CI on the final head is the gate.Final hosted CI completed on
c7c0c3e742b7893dd80934250ed7c455fa2e8fba: 137 successful jobs; only the three independently reproduced main failures and their aggregate gate remain red. Landing uses Peter's explicit inherited-failure exception, pinned to that exact API head. See the attribution comment above for matching test names, messages, clean-main SHA, and final job links.