perf: defer realtime smoke live imports#100002
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 4, 2026, 11:47 AM ET / 15:47 UTC. Summary PR surface: Other +5. Total +5 across 1 file. Reproducibility: yes. source-reproducible: current main eagerly imports the heavy realtime smoke dependencies before CLI help, invalid-argument handling, or imported helper tests can return. I did not execute tests because this review is read-only, but the source path and adjacent tests are clear. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the script-local lazy-import refactor after maintainer review and normal exact-head gates, preserving the existing smoke command, options, and secret-redaction behavior. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main eagerly imports the heavy realtime smoke dependencies before CLI help, invalid-argument handling, or imported helper tests can return. I did not execute tests because this review is read-only, but the source path and adjacent tests are clear. Is this the best way to solve the issue? Yes. Moving the four existing live-stack imports into the exact smoke paths that use them is the narrowest maintainable solution; splitting helpers into a separate lightweight module would add more surface for the same outcome. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ba7b5db74c91. Label changesLabel justifications:
Evidence reviewedPR surface: Other +5. Total +5 across 1 file. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (5 earlier review cycles)
|
|
Land-ready verification for rebased head
Known proof gaps: no live-provider credential run. The existing Gateway relay browser scenario reached its 15s wait but did not signal completion on Testbox; this PR does not alter that scenario's code. Dependency loading, build/runtime resolution, and all changed/tooling tests are covered. |
9984e3e to
b9578d2
Compare
b9578d2 to
223a9d6
Compare
|
Merged via squash.
|
What Problem This Solves
test/scripts/dev-tooling-safety.test.tseagerly loaded Playwright, Vite, Google GenAI, and the OpenAI realtime provider throughrealtime-talk-live-smoke.ts, even when tests imported only lightweight safety helpers or the CLI exited for--help/invalid arguments. This inflated tooling test time and memory.Why This Change Was Made
Move each existing heavy dependency behind the live smoke path that owns it:
The live workflow, dependency versions, and public options are unchanged. Installed dependency source/types and a runtime namespace probe confirm the same named ESM exports. All 58 tests were audited; each protects a distinct redaction, parsing, network-bound, process-tree, platform, CLI, or log-lifecycle contract, so none were removed.
User Impact
Developer smoke
--help, argument errors, and imported helper checks no longer initialize unused live stacks. The focused test is 48.6% faster locally with 24.5% lower peak RSS, and 31.1% faster on Linux. Live smoke behavior is unchanged.Evidence
check:changed: Testboxtbx_01kwpsgt14gkvnn96fensnny9d, Actions run https://github.com/openclaw/openclaw/actions/runs/28709734929, exit 0[INEFFECTIVE_DYNAMIC_IMPORT]warningtest:changed: 285 files, 4,516 passed, 15 skipped; Testboxtbx_01kwpt6t12bpqdjwkzgb3a5w7j, Actions run https://github.com/openclaw/openclaw/actions/runs/28710040961, exit 0pnpm format:check scripts/dev/realtime-talk-live-smoke.ts— passgit diff --check— passRelated: #57266