Repository navigation
test: consolidate CLI regressions and simplify IPC lifecycle proof - #29298
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
🧹 Nitpick comments: 1
src/cli/runtime-client.test.ts: 1
455-489: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueThe test passes only because the mock server accepts a request that the real contract rejects.
The test calls
client.call('terminal.wait')with no params. TheTerminalWaitschema insrc/shared/rpc-contract/terminal-unary-params.tsrequires a handle and aforvalue. The test therefore does not show that a real runtime accepts this request. It checks only thatRuntimeClient.calldoes not throw while it resolves the default timeout.Rename the test so the name states the real intent. For example, use
resolves the default terminal.wait timeout when params are omitted. Do not imply that the request is valid.The mock server also throws inside a socket
datahandler when the request is invalid. That throw becomes an uncaught exception, not a clean test failure. Write an error response instead.Proposed change
- it('does not crash while resolving terminal.wait defaults without params', async () => { + it('resolves the default terminal.wait timeout when params are omitted', async () => {- throw new Error('Expected a runtime request with an id') + socket.destroy(new Error('Expected a runtime request with an id')) + return
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
994b0e7e-519d-441a-9582-d3e507b85b11
📒 Files selected for processing: 16
config/scripts/anti-slop-scope-regression.test.mjsconfig/scripts/check-runtime-electron-ratchet.test.mjsconfig/scripts/ime-enter-guard-plugin.test.mjsconfig/scripts/native-chat-design-tokens-plugin.test.mjsconfig/scripts/oxlint-plugin-test-runner.mjsconfig/scripts/quadratic-buffer-concat-plugin.test.mjsconfig/scripts/renderer-scrollbar-style-plugin.test.mjssrc/cli/handlers/orchestration-caller-identity-cli.test.tssrc/cli/handlers/orchestration-module-boundaries.test.tssrc/cli/handlers/orchestration.test.tssrc/cli/handlers/orchestration/worker-output.test.tssrc/cli/runtime-client.test.tssrc/cli/runtime/client-timeout-policy.test.tssrc/cli/runtime/transport-framing.test.tssrc/renderer/src/hooks/ipc-events/app-lifetime-ipc-bridge.tssrc/renderer/src/hooks/useIpcEvents-lifecycle.test.ts
💤 Files with no reviewable changes: 4
- src/cli/runtime/client-timeout-policy.test.ts
- src/cli/handlers/orchestration-module-boundaries.test.ts
- config/scripts/check-runtime-electron-ratchet.test.mjs
- src/cli/runtime/transport-framing.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
…ner-coverage # Conflicts: # src/shared/git-binary-compatibility.test.ts
…ner-coverage # Conflicts: # mobile/src/session/MobileNativeChatView.test.ts
…ner-coverage # Conflicts: # config/oxlint-anti-slop.json
ELI5
Keep regression tests with the code that owns their behavior, and remove checks that merely repeat implementation details or test their own mocks.
What Changed
Retire two standalone CLI suites after moving their unique formatting, dispatch, and real-socket timeout regressions into existing owner suites. The unsafe-integer helper replay is already covered through real handlers; payload normalization now runs through the handler too. Remove a Unicode test that did its own decoding before handing strings to a mock socket. The remaining framing table checks production's UTF-8 setup and fragmented Unicode response.
Simplify renderer IPC lifecycle proof: keep listener cleanup/remount and causal subscription-before-snapshot assertions; remove copied channel inventories, a mocked React dependency-array assertion, and a post-cleanup assertion whose fixture could never dispatch. Remove the production cleanup-phase observer used only by that test. Executable cleanup operations/order remain unchanged.
Why
These tests should catch lost behavior while permitting internal refactors. Consolidation avoids two isolated suite setups and fixes the moved timeout fixture's temporary-directory leak. Copying entire registration inventories adds maintenance without testing each feature's behavior.
Linked Issue
Maintainer-requested CI test audit. Base PR #29286 is merged. This branch now includes main at24bec2d260; final main-based CI must pass before merge.
Visual Proof
N/A — test maintenance and removal of a test-only production observer; UI behavior unchanged.
Testing
Linux: 250 tests passed across 18 focused suites using the CI coordinator/runtime versions (Bun 1.4.3 and Node 24.21.0). CLI and web typechecks passed. Changed-code-quality, formatting, and whitespace gates pass. Independent preservation reviews found no lost contracts.
Three alternating local comparisons refreshed against main a49295f, with explicit Node24.21.0 Vitest and two workers:
CLI elapsed fell 10.2%; IPC elapsed fell only 1.2%, treated as noise with no stable speedup claim. Earlier local comparisons (CLI2.540→2.316s, IPC4.443→4.469s) are retained in the audit evidence. Every comparison run passed. Hosted selected module-duration-v1 worker cost: CLI3532→3020ms(-14.5%), lifecycle3574→3327ms(-6.9%). All five unit jobs and all five timing reports pass with zero unhandled errors; every selected file passes. Baseline run38827086842 actual79f463a863, candidate run38844420635 actualc62610908d. Both use Node24.21/Bun1.4.3, five ARM shards/four workers. This historical unpaired comparison is not whole-PR elapsed time or an isolated causal estimate: main changed imports, runtime routing and suite consolidation/shard contention. Candidate checkout has five unrelated CI/cache paths beyond head8486; baseline has19 unrelated merge-checkout paths. Neither checkout drift changes selected owners/routing. Full aggregate must still pass before merge. After merging current main at a49295f, 151 tests across 12 affected owner/sibling suites passed again under the exact CI runtimes, and full pnpm tc passed; the nine-file audit diff is preserved. Current main updates the project-catalog bridge, and its relevant catalog and worktree-event siblings are included in this check.
Earlier CI runs exposed inherited Git/mobile line-limit failures; main independently split both suites (#29357, #29368), so our temporary repairs were removed. Main subsequently landed the same mobile-fixture lint classification (#29378); reconciliation adopts main's config exactly and removes our duplicate. The final diff is the original nine CLI/lifecycle audit files only. The intermediate config repair was locally measured (77→76ms), hosted (21.5→23.7s), and independently reviewed, with12→0errors and no speed claim; those measurements are history, not final-diff savings.
Current head includes main24bec2d260. CLI and renderer-hook sources are byte-unchanged from measured head8486aab522. After reconciliation, all131 directly affected tests across9suites, full pnpm tc, changed-code quality and diff checks pass. The hosted owner comparison above comes from preceding head8486aab522; fresh full required CI/aggregate must pass for the new head before merge.
Review
Preserved distinctive contracts: blank terminal lines, circular tool input, image references, ordered release receipts, dry-run preamble without recipient, lookup without coordinator resolution, and real omitted-params timeout resolution. Renderer proof checks actual registered listener cleanup and remount instead of copied inventories. Net test/support reduction ~400 lines; production removes 18 lines, adds no behavior.
Agent skill upstream boundary
Checklist