Skip to content

perf: defer realtime smoke live imports#100002

Merged
steipete merged 1 commit into
mainfrom
test/dev-tooling-safety-tests-fast
Jul 4, 2026
Merged

perf: defer realtime smoke live imports#100002
steipete merged 1 commit into
mainfrom
test/dev-tooling-safety-tests-fast

Conversation

@steipete

@steipete steipete commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

test/scripts/dev-tooling-safety.test.ts eagerly loaded Playwright, Vite, Google GenAI, and the OpenAI realtime provider through realtime-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:

  • OpenAI provider runtime inside the backend bridge smoke
  • Google GenAI inside token creation
  • Vite inside the Gateway relay browser smoke
  • Playwright after CLI argument/help validation

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

Related: #57266

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XS maintainer Maintainer-authored PR labels Jul 4, 2026
@clawsweeper

clawsweeper Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 4, 2026, 11:47 AM ET / 15:47 UTC.

Summary
The PR moves Google GenAI, Playwright, Vite, and the OpenAI realtime provider imports from module scope into the specific realtime smoke paths that use them.

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.

  • Deferred live-stack imports: 4 deferred. This is the actual performance surface and confirms the PR does not add config, API, default, migration, or user-runtime behavior changes.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster ✨ media proof bonus
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • [P1] No credentialed OpenAI/Google live-provider run is attached for the current head; residual risk is limited because the PR moves existing imports without changing smoke payloads, options, dependency versions, or documented command behavior.

Maintainer options:

  1. Decide the mitigation before merge
    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.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P2] No repair lane is needed; the patch review is clean and the remaining action is maintainer landing judgment for a protected-label PR after normal exact-head gates.

Security
Cleared: The diff only defers existing imports in a maintainer script and does not change workflows, lockfiles, dependency sources, package metadata, secrets handling, permissions, or downloaded code execution.

Review details

Best 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 changes

Label justifications:

  • P3: This is a low-risk maintainer tooling performance cleanup with no end-user runtime contract change.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): Sufficient linked proof: the PR body and follow-up comment include after-fix timing/RSS data, Testbox/Actions references, and no-credential runtime smoke evidence, and the current head is unchanged from the proofed script blob.
  • proof: sufficient: Contributor real behavior proof is sufficient. Sufficient linked proof: the PR body and follow-up comment include after-fix timing/RSS data, Testbox/Actions references, and no-credential runtime smoke evidence, and the current head is unchanged from the proofed script blob.
Evidence reviewed

PR surface:

Other +5. Total +5 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 10 5 +5
Total 1 10 5 +5

What I checked:

Likely related people:

  • vincentkoc: git log -S shows commit e085fa1a3ffd touching the realtime smoke script/test surface, and GitHub commit metadata maps that work to vincentkoc. (role: recent area contributor; confidence: high; commits: e085fa1a3ffd; files: scripts/dev/realtime-talk-live-smoke.ts, test/scripts/dev-tooling-safety.test.ts)
  • steipete: GitHub commit metadata maps a23ab9b906dc to steipete, and that commit moved the OpenAI realtime provider into the extension path this smoke script imports; the current PR also builds on that same surface. (role: feature introducer and recent area contributor; confidence: high; commits: a23ab9b906dc, 223a9d6113ba; files: extensions/openai/realtime-voice-provider.ts, scripts/dev/realtime-talk-live-smoke.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (5 earlier review cycles)
  • reviewed 2026-07-04T15:12:20.842Z sha 9984e3e :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-04T15:18:32.497Z sha 9984e3e :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-04T15:28:09.497Z sha b9578d2 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-04T15:33:53.297Z sha b9578d2 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-04T15:41:12.231Z sha 223a9d6 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jul 4, 2026
@steipete

steipete commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready verification for rebased head 223a9d6113bab48bc6dea5be8e3d94a3a71a283d:

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.

@steipete
steipete force-pushed the test/dev-tooling-safety-tests-fast branch from 9984e3e to b9578d2 Compare July 4, 2026 15:23
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jul 4, 2026
@steipete
steipete force-pushed the test/dev-tooling-safety-tests-fast branch from b9578d2 to 223a9d6 Compare July 4, 2026 15:37
@steipete
steipete merged commit e643828 into main Jul 4, 2026
134 of 135 checks passed
@steipete
steipete deleted the test/dev-tooling-safety-tests-fast branch July 4, 2026 15:52
@steipete

steipete commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. scripts Repository scripts size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant