Repository navigation
refactor: remove vestigial runtime indirection - #124554
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 16, 2026, 8:28 AM ET / 12:28 UTC. ClawSweeper reviewWhat this changesThis PR deletes private runtime pass-through modules, imports their owners directly, and replaces test-only module mocks with narrow handler-level injection while preserving public plugin SDK exports. Merge readinessNo blocking correctness or security finding was found. This maintainer-authored, maintainer-labeled cleanup should remain open for the in-progress exact-head lifecycle check and final maintainer review. Priority: P3 Review scores
Verification
How this fits togetherPlugin SDK facades expose stable channel capabilities to plugins, while gateway and CLI modules connect commands and runtime state to OpenClaw services. The change removes private forwarding layers between those inputs and their existing runtime owners. flowchart LR
Plugins[Plugins and channels] --> SDK[Plugin SDK facades]
Commands[Native command lookup] --> Registry[Command registry]
Gateway[Gateway requests] --> Handlers[Gateway handlers]
CLI[Gateway installation] --> Token[Token persistence]
SDK --> Owners[Runtime owner modules]
Registry --> Owners
Handlers --> Owners
Token --> Owners
Decision needed
Why: The source evidence supports the refactor, but the PR is maintainer-labeled and its final exact-head lifecycle validation is not yet complete. Before merge
Agent review detailsSecurityNone. PR surfaceSource -156, Tests -3. Total -159 across 39 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the net-negative owner-direct refactor once the exact-head lifecycle check succeeds and the maintainer confirms the remaining intentional runtime seams. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR refactors internal ownership and does not report a user-visible defect to reproduce. Is this the best way to solve the issue? Yes: deleting name-only private barrels while preserving public SDK facades and injecting only the test substitution points is the cleaner canonical boundary than retaining mock-only runtime files. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 66db70133b2c. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Land-ready review complete for
|
|
Merged via squash.
|
* refactor: remove vestigial indirection * test: update Slack runtime API guard
…ventory proof Replays the Gate 3g stability half of openclaw#121204: isolate CLI boundary output and expected CLI error routing, stabilize unit ordering, extend the full-unit silence watchdog, and add the repository-scale tracked-path inventory regression for check-temp-path-guardrails. Two openclaw#121204 repairs are deliberately not replayed because current upstream already fixed the same root causes more strongly: - scripts/check-temp-path-guardrails.ts: openclaw#121204 bounded the ENOBUFS crash by adding maxBuffer to its local execFileSync git ls-files. Upstream openclaw#124554 replaced that call site entirely with listRepoFilesSync, which already carries a bounded maxBuffer, a timeout, SIGKILL, and a filesystem fallback. Upstream's fix is kept and the now-dead GIT_LS_FILES_MAX_BUFFER_BYTES constant is not introduced. The added test asserts the behavior, not the literal, so it still proves the >1 MiB inventory path exits 0. - extensions/google-meet/src/oauth.test.ts: openclaw#121204 made the timeout proof it.skipIf(!callbackPortAvailable), which skips the assertion whenever host port 8085 is busy. The composite base already fixes the same flake deterministically by binding a free port through the callbackPort seam, so the assertion always runs. The base fix is kept and the skip machinery (node:dns lookup, isCallbackPortAvailable, callbackPortAvailable) is dropped as dead. openclaw#121204's independent closeServer listening guard and closeAllConnections leak fix and its GOOGLE_MEET_CALLBACK_PORT constant are kept. Provenance (openclaw#121204 authored commits): e175bf5 bf652e3 94287e2 ee3346d 3bf1ca1 c704dfa Co-authored-by: Copilot <[email protected]>
… tsx runner Composite interaction between openclaw#121204 and current upstream. openclaw#121204's new repository-scale inventory test spawned scripts/check-temp-path-guardrails.ts with a bare process.execPath. That worked only incidentally: at openclaw#121204's base the guard's import closure was node-resolvable. Upstream openclaw#124554 replaced its local execFileSync git ls-files with listRepoFilesSync from ./check-file-utils.js, a relative TypeScript source specifier that plain Node cannot resolve, so the child died with ERR_MODULE_NOT_FOUND and the test read that crash as a guard failure. The guard has always been a tsx entrypoint — package.json runs `node --import tsx scripts/check-temp-path-guardrails.ts` — so the test now launches it the same way instead of asserting against an import closure the repo never promised. tsx is pre-resolved from this file because the child runs with cwd set to the temporary repo, where a bare `--import tsx` would not resolve. The protected behavior is unchanged: a tracked inventory larger than Node's 1 MiB default child-process buffer must still exit 0. Co-authored-by: Copilot <[email protected]>
What Problem This Solves
Several internal barrels, type-renaming bridges, and statically imported
*.runtime.tsfiles no longer owned a real lazy or architectural boundary. They added extra files and mock targets while their only production consumers immediately re-exported or statically imported them. The command registry also repeated channel-adapter resolution and native-name normalization within one operation.Why This Change Was Made
This removes only indirection that can be absorbed by the actual owner while preserving public Plugin SDK names exactly:
openclaw-tools.runtime.ts,server-node-events.runtime.ts, andtools-effective.runtime.ts;Promise<void>fromprepareGatewayAgentCliShim()because production never reads its former path object;User Impact
No user-visible behavior or public export name changes. This is a net-negative internal cleanup that removes obsolete paths while keeping the lazy, plugin, command, session-lifecycle, and persistence ownership boundaries intact.
Evidence
96cacfdf74503baf1b9175b25f5a5aedb7b312b2; exact PR head55a624e3df9d5b873fa1e86bb00f72cc459bd375.src/commands/gateway-install-token.test.ts+src/commands/models/load-config.test.ts: 14 tests passed;pnpm build: passed on Blacksmith Testboxtbx_01m056ej7bb5ajfex8wk0x1b3b(wrapper exit 0, 3m58s; Actions run https://github.com/openclaw/openclaw/actions/runs/31945352719). No[INEFFECTIVE_DYNAMIC_IMPORT]diagnostics.pnpm check:changed: passed on the same Testbox (wrapper exit 0, 17m05s), including format, Plugin SDK exports/surface, plugin boundaries, dead exports, core/extension/script/test typechecks, lint, import cycles, and database/runtime guards.