Skip to content

[CI] test: reduce session imports and mocked recovery waits - #26567

Merged
nwparker merged 1 commit into
mainfrom
nwparker/ci-session-imports-and-recovery
Oct 8, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/ci-session-imports-and-recovery

Conversation

@nwparker

@nwparker nwparker commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Tests spend less time loading web-session code and waiting for a mocked process to stop. The application and all existing test checks stay unchanged.

What Changed

Use the same operations from their existing modules in 47 tests and their harness. Preserve the harness’s browser registration, shared state, public API coverage, callbacks, mocks, hooks and deadlines.

One recovery test supplies an async no-op to the existing resolver’s delay dependency. Its owner probe is mocked and clock fixed; all probe iterations, stop signals and real store/journal transitions remain. Restore the spy before the original assertions and session attach.

Why

Direct imports avoid loading unused operations while reusing actual owners. The existing delay dependency removes mocked pacing waits while preserving migration checks and real process deadlines.

Linked Issue

N/A — internal CI capacity work.

Visual Proof

N/A — test imports and one mocked test dependency only; no UI or application behavior changes.

Testing

  • Manually tested locally — no local app or test execution for this preparation.
  • Existing tests updated; all original cases, assertions and mock factories retained.
  • Current-source full CI, official module/case totals and review complete.

Web-session imports: correctness run 37729112594 passed eight original/candidate commands across Bun and Node with two seeds: exact maps for 513 passed cases in 62 files. Timing run 37731201208 retained all six full commands on one Linux ARM4 runner:

Pair Before (s) After (s) Less time
1 43.654450 30.195798 30.830%
2 30.865007 29.988149 2.841%
3 30.548205 29.192107 4.439%

Means: 35.022554 → 29.792018 seconds (14.935% less cohort time). The much larger first-pair improvement is confounded by shared warming; the later two averaged 3.636% less time. Process snapshots run every five seconds while each command is active; their observer overhead is included, with no added five-second wait or tail. Qualification occupied 597 runner-seconds across four hosts plus the collector; the timing host occupied 249 seconds and queued 5 seconds.

Mocked recovery: run 37749440808 passed eight original/candidate commands with exact 19-case maps across both parent runtimes and seeds. The fixture retained its protected Node route. Its six following full commands were:

Pair Before (s) After (s) Less time
1 10.506219 3.859155 63.268%
2 10.534153 3.728571 64.605%
3 10.536008 3.883857 63.137%

Means: 10.525460 → 3.823861 seconds (63.670% less fixture-command time). This one host occupied 186 seconds: 76.082 seconds of qualification commands and 43.048 seconds of timing commands, plus setup/collection/upload; it queued 914 seconds. Queue time is separate from occupied runner cost.

Both trials retained all first commands in before/after, after/before, before/after order, with four workers, isolation, six setups and the shipping filesystem cache. Recovery qualification preceded timing on the same host. Shared OS/Bun/cache warming limits interpretation; these are scoped observations, not a whole-CI 2× or fleet capacity claim.

Measured sources were 8b20d211 (imports) and 3b24c0d4 (recovery). The 28 later type-import syntax cleanups were source-checked, not separately timed. On named main 7c50009c, all 49 originals match the source proposal and committed head f956a01c reproduces the candidate bytes from 6fad8c40. All 116 guarded owners/configuration paths still match the proposal’s e0a98a4f source; the recently merged test cleanup is retained. Against branch base a2114892, 115/116 source guards match; only an unrelated SQLite registry addition differs and remains preserved. Current-source full CI now passes; official results are below. Node proof covers the launcher receipt/source chain and route, not a sampled worker binary.

Current PR Checks, Mobile, Node-server detector and LoC all pass. Static analysis/typecheck, all ten unit shards, relay, wire compatibility, Linux and Windows packaging, the selected two-app Electron check and final verification pass. Headless-server platform builds correctly skip because their inputs are unchanged; skipped optional checks are not claimed as executed.

Current full validation completed successfully across all four attached workflows. It occupied 4,916 runner-seconds in 24 allocated jobs (46 declared): 4,570 for PR Checks, 24 for the Node-server detector, 310 for Mobile and 12 for LoC. Pool totals were 3,981 ARM, 583 ubuntu-latest, 291 Windows and 61 ubuntu-slim runner-seconds.

The ten unit jobs occupied 3,290 seconds: 2,934 in Test shard steps, 321 before them and 35 afterward. The longest test step took 315 seconds; the largest unit creation-to-start delay was 699 seconds, counted separately from occupied time. The previous PR26546 validation used 3,244 unit runner-seconds; this run used 46 more (1.42%) on different source, hosts and allocations. This unpaired observation establishes neither a fleet saving nor a causal regression. The earlier correctness/timing diagnostics occupied 597 + 249 + 186 = 1,032 seconds and remain separate from normal-PR accounting.

All 11,833 modules appear exactly once across the ten shard reports: 113,859 passed, three expected failures and 1,069 skips, with zero unhandled errors. Actual reported routes match the full source plan: 10,682 Bun, 1,150 Node-runtime and one measurement module. All 62 original web-session cohort modules passed with 513 cases, and recovery passed all 19 cases on Node. Current logs provide module counts and status, while historical exact title-map qualifications and scoped timings retain their original source scope.

The historical diagnostics and this full validation together used 5,948 occupied seconds; no new diagnostic was launched for this integration. This validation still selects packaging/Electron work when the shared unit harness changes, due to existing filename routing. That cost is included above. A separate exact-harness routing proposal is held for direct-import protection and runtime qualification; it is not part of this patch.

The actual tested merge e02a8136 has the exact shipping-head tree, with parent 7c50009c. All 49 edited targets match the reviewed candidate, and the 67 other guarded owners/configuration paths remain exact. A fresh main check still finds 7c50009c; no rebase or untested source substitution occurred.

Review

Archived source, raw-map and measurement reviews passed. Current-source static formatter, lint and normal commit hooks pass; independent source and official-report review verifies unchanged callbacks, local import bindings, browser registration and complete enrollment. CodeRabbit reviewed the exact f956a01c head and generated no actionable comments; the final saved review snapshot has zero inline threads. No additional benchmark or shared-cache warmer job is introduced.

Agent skill upstream boundary

  • Not applicable; no upstream skill-installer source, tests or documentation copied.

Notes

Production and SSH/folder-workspace, wire, native-runtime, security and platform contracts remain unchanged. The separate prose/count-test cleanup is outside this change.

Checklist

  • Small and focused: 48 import targets and one mocked recovery fixture
  • Before/after, mechanism and reason explained
  • Visual proof N/A with reason
  • Source and ownership self-reviewed; independent peer reviewed
  • Cross-platform, SSH/remote and compatibility impact considered
  • Current-source CI lint, typecheck, tests and selected Linux/Windows package builds pass; existing policy-skipped checks are not claimed as run.

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8d6cc7f0-650f-4bb1-9300-15f75a165c61
📥 Commits

Reviewing files that changed from the base of the PR and between 7c50009 and f956a01.

📒 Files selected for processing (49)
  • src/main/native-chat/agent-session-wire/structured-agent-session-wedged-profile-migration.test.ts
  • src/renderer/src/components/native-chat/StructuredAgentSessionAttentionBridge.test.tsx
  • src/renderer/src/components/sidebar/worktree-agent-remote-attribution.test.ts
  • src/renderer/src/runtime/host-session-mirror-empty-inventory-settle.test.ts
  • src/renderer/src/runtime/mirrored-agent-status-clock-skew.test.ts
  • src/renderer/src/runtime/paired-agent-row-turn-outcome-arms.test.ts
  • src/renderer/src/runtime/paired-reconnect-sidebar-agent-count.test.ts
  • src/renderer/src/runtime/remote-agent-row-last-assistant-message.test.ts
  • src/renderer/src/runtime/remote-server-parity.test.ts
  • src/renderer/src/runtime/structured-conversation-tab-replacement.test.ts
  • src/renderer/src/runtime/web-session-open-files-batch-equivalence.test.ts
  • src/renderer/src/runtime/web-session-split-pane-retirement-fences.test.ts
  • src/renderer/src/runtime/web-session-structured-tab-focus.test.ts
  • src/renderer/src/runtime/web-session-tabs-agent-completion-notifications.test.ts
  • src/renderer/src/runtime/web-session-tabs-late-merged-predecessor-lockout.test.ts
  • src/renderer/src/runtime/web-session-tabs-publisher-identity-lineage.test.ts
  • src/renderer/src/runtime/web-session-tabs-removed-frame-retires-live-publisher.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync-agent-handoff.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync-agent-status.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync-browser-tabs.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync-client-owned-page-content.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync-client-owned-placement.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync-diff-focus-steal.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync-editor-tabs.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync-emptied-workspace-tombstone.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync-focus-intent.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync-host-restart-browser-rows.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync-host-tab-retraction-ghost-rows.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync-html-preview-focus.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync-layout-duplicate-groups.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync-layout-groups.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync-mirror-identity.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync-remote-main-agent-verdict.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync-remote-status-title-flap.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync-restored-browser-rows.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync-snapshot-batch.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync-staged-browser-adoption.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync-staged-browser-authority.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync-terminal-bootstrap.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync-terminal-mirroring.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync-test-harness.ts
  • src/renderer/src/runtime/web-session-tabs-sync-tracking-teardown.test.ts
  • src/renderer/src/runtime/web-session-terminal-orphan-inventory-retry.test.ts
  • src/renderer/src/runtime/web-session-terminal-orphan-mixed-version.test.ts
  • src/renderer/src/runtime/web-session-terminal-orphan-recovery-adoption-regressions.test.ts
  • tests/e2e/omp-risk-remote-review.unit.test.ts
  • tests/e2e/remote-terminal-tab-retirement.unit.test.ts
  • tests/e2e/session-tabs-decorative-title-fanout.unit.test.ts
  • tests/e2e/session-tabs-empty-inventory-daemon-oracle.unit.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

One recovery test disables the recovery-resolution delay during session restoration and restores the original resolver afterward. Across renderer, component, and end-to-end tests, imports move from the aggregate web-session-tabs-sync module to dedicated synchronization modules. The import changes do not alter test behavior.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to f956a

The changes are limited to test imports and recovery-test timing, with no merge-blocking behavior change established. Normal CI validation remains outstanding.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 4…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes both primary changes: reducing session imports and removing mocked recovery waits.
Description check ✅ Passed The description covers the required sections, explains the changes and rationale, documents testing and review results, provides a reason for the N/A visual proof, and addresses compatibility and plat…
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker merged commit 47165c9 into main Oct 8, 2026
46 checks passed
@nwparker nwparker changed the title test: reduce session imports and mocked recovery waits [CI] test: reduce session imports and mocked recovery waits Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant