Skip to content

refactor(renderer): remove the web-runtime-session barrel - #27967

Merged
OrcaWin merged 1 commit into
mainfrom
OrcaWin/p399-3-5a
Oct 12, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
OrcaWin/p399-3-5a

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 87 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​328 $\color{#cf222e}{\Huge{\mathbf{−}}}$​159 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​169
Prod 52 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​118 $\color{#cf222e}{\Huge{\mathbf{−}}}$​151 $\color{#cf222e}{\Huge{\mathbf{−}}}$​33

ELI5

src/renderer/src/runtime/web-runtime-session.ts contained no code of its own. It re-exported about 25 functions and types from a dozen other files. This PR points every importer at the file that defines what it uses, and deletes the forwarding file.

What Changed

Users see no difference.

  • Production: ~60 renderer files import from the defining modules instead, for example web-runtime-terminal-creation, web-runtime-session-tab-lifecycle, web-runtime-terminal-actions, web-runtime-session-environment and web-terminal-surface-id. That includes the five lazy import() calls in the store, which now load only the module they need.
  • Tests: each vi.mock('@/runtime/web-runtime-session', …) is split into one mock per defining module, with the same mocked values. The five importOriginal mocks that replaced createWebRuntimeSessionTerminal now mock web-runtime-terminal-creation. The floating-panel test helper has one factory per module.
  • CI routing: the restart-binding e2e route listed the barrel by name. It now lists the modules that do the work (web-runtime-terminal-creation, web-runtime-session-tab-lifecycle), and its contract test was updated to match.

Net: production −57 (+73/−130), tests +192 (+370/−178; the split mocks).

Why

AGENTS.md and the Phase 3.99 design rule out barrels. They hide which module a file really depends on, and they make a mock of "the session" silently cover a dozen modules. With direct imports, each test mocks exactly the module the code under test calls. This is one of the six barrel PRs (3.5a–f), done one barrel per PR.

Linked Issue

N/A, internal Phase 3.99 cleanup (PR 3.5a).

Visual Proof

N/A, no UI or behaviour change.

Testing

  • No import, mock, import() or re-export of runtime/web-runtime-session remains in src tests mobile config .github (@ts-nocheck files included). The unrelated web/preload-api/web-runtime-session.ts is untouched.

  • pnpm test src/renderer tests/e2e: 4836 files, 41635 tests pass. The 6 local failures need things this machine lacks (the cloud relay's pg package, and builds of old refs for the cross-version wire tests) and are unrelated to this change.

  • pnpm tc, pnpm lint, pnpm run check:code-quality:changed (0 findings), build:electron-vite, build:web-from-renderer, and the PR e2e routing contract tests pass.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Review

P0/P1 review: my own review plus an independent reviewer.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Renderer-only import changes, with no runtime behaviour change. The lazy imports keep their lazy loading. SSH, wire, mobile and platforms are not affected.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 12, 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: fde4d09f-9110-4eb0-9f53-f71fc45fe003

📥 Commits

Reviewing files that changed from the base of the PR and between c77bebf and 63947d7.


📒 Files selected for processing (139)
  • config/scripts/pr-e2e-gate-contract.test.mjs
  • config/scripts/pr-e2e-source-routing.mjs
  • src/renderer/src/components/automations/automation-run-workspace-action.paired-server.test.ts
  • src/renderer/src/components/automations/automation-run-workspace-action.ts
  • src/renderer/src/components/browser-pane/ClientHostedBrowserPagePane.drag-focus.test.tsx
  • src/renderer/src/components/browser-pane/ClientHostedBrowserPagePane.test.tsx
  • src/renderer/src/components/browser-pane/browser-reopen-on-server.test.ts
  • src/renderer/src/components/browser-pane/browser-reopen-on-server.ts
  • src/renderer/src/components/browser-pane/restored-client-hosted-recovery-window.test.tsx
  • src/renderer/src/components/floating-terminal/FloatingTerminalPanel.bounds.test.tsx
  • src/renderer/src/components/floating-terminal/FloatingTerminalPanel.focus.test.tsx
  • src/renderer/src/components/floating-terminal/FloatingTerminalPanel.shortcuts.test.tsx
  • src/renderer/src/components/floating-terminal/FloatingTerminalPanel.tab-lifecycle.test.tsx
  • src/renderer/src/components/floating-terminal/floating-terminal-panel-test-module-mocks.ts
  • src/renderer/src/components/floating-terminal/floating-workspace-tab-reorder.test.ts
  • src/renderer/src/components/right-sidebar/ai-vault-session-launch-actions.test.ts
  • src/renderer/src/components/tab-bar/web-runtime-tab-move-mirror.ts
  • src/renderer/src/components/tab-group/tab-drag-retained-guest-passthrough.test.tsx
  • src/renderer/src/components/tab-group/useTabDragSplit.test.ts
  • src/renderer/src/components/tab-group/useTabGroupActivationCommands.ts
  • src/renderer/src/components/tab-group/useTabGroupCreationCommands.ts
  • src/renderer/src/components/tab-group/useTabGroupTabCloseCommands.structured-session.test.ts
  • src/renderer/src/components/tab-group/useTabGroupTabCloseCommands.test.tsx
  • src/renderer/src/components/tab-group/useTabGroupWorkspaceModel.focus.test.ts
  • src/renderer/src/components/terminal-pane/paired-reconnect-multi-pane-materialization.test.ts
  • src/renderer/src/components/terminal-pane/pending-split-close-test-fixture.ts
  • src/renderer/src/components/terminal-pane/remote-pane-layout-push.test.ts
  • src/renderer/src/components/terminal-pane/remote-pane-layout-push.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-outage-toast-flood-and-stuck-reconnect.test.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-deadline-reattach.test.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-latched-pane-retention.test.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-test-harness.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-resubscribe-failure-recovery-routing.test.ts
  • src/renderer/src/components/terminal-pane/terminal-chat-ownership-lifecycle.test.tsx
  • src/renderer/src/components/terminal-pane/terminal-input-mode-reset.ts
  • src/renderer/src/components/terminal-pane/terminal-layout-gesture-persist.test.tsx
  • src/renderer/src/components/terminal-pane/terminal-pane-mount-events.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-split-with-inherited-cwd.test.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-split-with-inherited-cwd.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-close-actions.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-layout-persistence.ts
  • src/renderer/src/components/terminal/terminal-close-confirm-keyboard-vs-mouse.test.ts
  • src/renderer/src/components/terminal/terminal-tab-actions-kill-all.test.ts
  • src/renderer/src/components/terminal/terminal-tab-actions-unified-close.test.ts
  • src/renderer/src/components/terminal/terminal-tab-actions-unrouted-close.test.ts
  • src/renderer/src/components/terminal/terminal-tab-actions.test.ts
  • src/renderer/src/components/terminal/terminal-tab-actions.ts
  • src/renderer/src/components/terminal/terminal-tab-bulk-actions.ts
  • src/renderer/src/components/terminal/terminal-tab-close-running-confirm.test.ts
  • src/renderer/src/components/terminal/terminal-tab-create.ts
  • src/renderer/src/components/use-terminal-activation-actions.ts
  • src/renderer/src/components/use-terminal-bulk-close-actions.ts
  • src/renderer/src/components/use-terminal-create-actions.test.tsx
  • src/renderer/src/components/use-terminal-create-actions.ts
  • src/renderer/src/hooks/ipc-events-terminal-create-test-harness.ts
  • src/renderer/src/hooks/ipc-events-test-harness.ts
  • src/renderer/src/hooks/ipc-events/tab-lifecycle-ipc-bridge.test.ts
  • src/renderer/src/hooks/ipc-events/tab-lifecycle-ipc-bridge.ts
  • src/renderer/src/hooks/useIpcEvents-close-routing-active-browser-tab.test.ts
  • src/renderer/src/lib/agent-launch-caller-permissions.test.ts
  • src/renderer/src/lib/agent-launch-caller-placement.test.ts
  • src/renderer/src/lib/agent-launch-caller-prompt-transport.test.ts
  • src/renderer/src/lib/agent-launch-caller-routing.test.ts
  • src/renderer/src/lib/floating-workspace-terminal-actions.test.ts
  • src/renderer/src/lib/launch-agent-in-new-tab-cwd.test.ts
  • src/renderer/src/lib/launch-agent-in-new-tab-host-resolution.test.ts
  • src/renderer/src/lib/launch-agent-in-new-tab-placement.test.ts
  • src/renderer/src/lib/launch-agent-in-new-tab-web-runtime.test.ts
  • src/renderer/src/lib/launch-agent-in-new-tab-windows-quoting.test.ts
  • src/renderer/src/lib/launch-agent-in-new-tab.test.ts
  • src/renderer/src/lib/launch-agent-in-new-tab.ts
  • src/renderer/src/lib/launch-agent-structured-chat-guard.test.ts
  • src/renderer/src/lib/launch-agent-web-host-tab.ts
  • src/renderer/src/lib/launch-ai-vault-session.test.ts
  • src/renderer/src/lib/launch-ai-vault-session.ts
  • src/renderer/src/lib/tab-number-shortcuts.ts
  • src/renderer/src/lib/terminal-tab-owner-activation.test.ts
  • src/renderer/src/lib/terminal-tab-owner-activation.ts
  • src/renderer/src/lib/web-runtime-worktree-terminal-after-wake.ts
  • src/renderer/src/lib/workspace-browser-tab-open.test.ts
  • src/renderer/src/lib/workspace-browser-tab-open.ts
  • src/renderer/src/lib/workspace-tab-palette-activation.test.ts
  • src/renderer/src/lib/workspace-tab-palette-activation.ts
  • src/renderer/src/lib/workspace-terminal-host-authority.ts
  • src/renderer/src/lib/worktree-activation.ts
  • src/renderer/src/lib/worktree-creation-agent-seeds.test.ts
  • src/renderer/src/runtime/browser-workspace-tab-close.test.ts
  • src/renderer/src/runtime/browser-workspace-tab-close.ts
  • src/renderer/src/runtime/close-mirrored-editor-tab.test.ts
  • src/renderer/src/runtime/close-mirrored-editor-tab.ts
  • src/renderer/src/runtime/host-session-mirror-hydration-frame-ordering.test.tsx
  • src/renderer/src/runtime/host-session-mirror-settle-receipt-frames.test.tsx
  • src/renderer/src/runtime/local-structured-session-tabs-host-isolation.test.ts
  • src/renderer/src/runtime/web-runtime-browser-capability-cleanup.test.ts
  • src/renderer/src/runtime/web-runtime-initial-terminal-bootstrap-dispatch.ts
  • src/renderer/src/runtime/web-runtime-session-browser-client-placement.test.ts
  • src/renderer/src/runtime/web-runtime-session-browser-create-failure.test.ts
  • src/renderer/src/runtime/web-runtime-session-browser-create-focus.test.ts
  • src/renderer/src/runtime/web-runtime-session-browser-create-split-placement.test.ts
  • src/renderer/src/runtime/web-runtime-session-browser-create-staged-focus.test.ts
  • src/renderer/src/runtime/web-runtime-session-browser-create-staged-hosting-intent.test.ts
  • src/renderer/src/runtime/web-runtime-session-browser-create-staging.test.ts
  • src/renderer/src/runtime/web-runtime-session-browser-placement-staleness.test.ts
  • src/renderer/src/runtime/web-runtime-session-tab-activate-close.test.ts
  • src/renderer/src/runtime/web-runtime-session-tab-move.test.ts
  • src/renderer/src/runtime/web-runtime-session-tab-props.test.ts
  • src/renderer/src/runtime/web-runtime-session-terminal-host-authority.test.ts
  • src/renderer/src/runtime/web-runtime-session-terminal-legacy-create.test.ts
  • src/renderer/src/runtime/web-runtime-session-terminal-pane-delegation.test.ts
  • src/renderer/src/runtime/web-runtime-session-terminal-workspace-routing.test.ts
  • src/renderer/src/runtime/web-runtime-session.test.ts
  • src/renderer/src/runtime/web-runtime-session.ts
  • src/renderer/src/runtime/web-session-tabs-sync-initial-terminal-relaunch.test.tsx
  • src/renderer/src/runtime/web-session-tabs-sync-mirrored-draft-close.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync-visibility-collision.test.tsx
  • src/renderer/src/runtime/web-session-tabs-sync-window-visibility.test.tsx
  • src/renderer/src/runtime/web-session-tabs-sync/active-session-subscription.ts
  • src/renderer/src/runtime/web-session-tabs-sync/agent-status-patch.ts
  • src/renderer/src/runtime/web-session-tabs-sync/agent-status-primitives.ts
  • src/renderer/src/runtime/web-session-tabs-sync/apply-preparation-base.ts
  • src/renderer/src/runtime/web-session-tabs-sync/apply-preparation-groups.ts
  • src/renderer/src/runtime/web-session-tabs-sync/apply-preparation-unified.ts
  • src/renderer/src/runtime/web-session-tabs-sync/layout-groups.ts
  • src/renderer/src/runtime/web-session-tabs-sync/terminal-build.ts
  • src/renderer/src/runtime/web-session-tabs-sync/terminal-surfaces.ts
  • src/renderer/src/store/index.ts
  • src/renderer/src/store/slices/active-selection-owner-scoping.test.ts
  • src/renderer/src/store/slices/browser-annotation-retention.test.ts
  • src/renderer/src/store/slices/browser-remote-page-lifecycle.test.ts
  • src/renderer/src/store/slices/browser-session-host-selection.test.ts
  • src/renderer/src/store/slices/browser-session-profiles.test.ts
  • src/renderer/src/store/slices/browser-workspace-host-ownership.test.ts
  • src/renderer/src/store/slices/browser.test.ts
  • src/renderer/src/store/slices/cmd-j-create-actions.test.ts
  • src/renderer/src/store/slices/tabs/tabs-host-mirroring.ts
  • src/renderer/src/store/terminals/terminal-active-workspace-creation.ts
  • src/renderer/src/store/terminals/terminal-tab-attention.ts
  • tests/e2e/paired-runtime-rejected-input-remount.unit.test.ts

💤 Files with no reviewable changes (1)
  • src/renderer/src/runtime/web-runtime-session.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.



📝 Walkthrough

Walkthrough

Production code now imports web-runtime APIs and types from dedicated modules instead of web-runtime-session, which was deleted. Tests and test harnesses update their imports and mocks to use those modules. E2E routing rules and their contract tests now match terminal-creation and session-tab-lifecycle paths in place of web-runtime-session.ts.


Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 63947

This is a refactor that changes import paths only. No user-visible behavior change is expected, and no concrete merge-blocking risk was identified.

Pre-merge checks | Passed 4 | Inconclusive 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage Inconclusive Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 50 files. (88 skipped… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: removing the web-runtime-session barrel.
Description check Passed The description includes all required sections, explains the change and rationale, documents testing and known environment-related failures, and marks visual proof as not applicable. The linked issue …
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.

Full details: Docstring Coverage

Explanation

Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 50 files. (88 skipped: 88 over the file limit.)


✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

  • Autofix · 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.

@OrcaWin
OrcaWin merged commit bce860f into main Oct 12, 2026
45 checks passed
tomarai85 added a commit to tomarai85/orca that referenced this pull request Oct 27, 2026
…t into

main (stablyai#27967) removed the runtime/web-runtime-session barrel, so these mocks stubbed a module
nothing imports. Mock web-runtime-terminal-actions, web-runtime-session-environment and
web-runtime-session-tab-move instead, as main's own tests now do.
tomarai85 added a commit to tomarai85/orca that referenced this pull request Oct 27, 2026
…t into

main (stablyai#27967) removed the runtime/web-runtime-session barrel, so these mocks stubbed a module
nothing imports. Mock web-runtime-terminal-actions, web-runtime-session-environment and
web-runtime-session-tab-move instead, as main's own tests now do.
lucacri pushed a commit to lucacri/orca that referenced this pull request Oct 27, 2026
lucacri pushed a commit to lucacri/orca that referenced this pull request Oct 27, 2026
lucacri pushed a commit to lucacri/orca that referenced this pull request Oct 27, 2026
lucacri pushed a commit to lucacri/orca that referenced this pull request Oct 28, 2026
lucacri pushed a commit to lucacri/orca that referenced this pull request Oct 28, 2026
lucacri pushed a commit to lucacri/orca that referenced this pull request Oct 28, 2026
lucacri pushed a commit to lucacri/orca that referenced this pull request Oct 28, 2026
lucacri pushed a commit to lucacri/orca that referenced this pull request Oct 30, 2026
lucacri pushed a commit to lucacri/orca that referenced this pull request Oct 30, 2026
lucacri pushed a commit to lucacri/orca that referenced this pull request Oct 30, 2026
lucacri pushed a commit to lucacri/orca that referenced this pull request Oct 30, 2026
lucacri pushed a commit to lucacri/orca that referenced this pull request Oct 31, 2026
lucacri pushed a commit to lucacri/orca that referenced this pull request Oct 31, 2026
lucacri pushed a commit to lucacri/orca that referenced this pull request Oct 31, 2026
lucacri pushed a commit to lucacri/orca that referenced this pull request Oct 31, 2026
lucacri pushed a commit to lucacri/orca that referenced this pull request Oct 31, 2026
lucacri pushed a commit to lucacri/orca that referenced this pull request Oct 31, 2026
lucacri pushed a commit to lucacri/orca that referenced this pull request Oct 31, 2026
lucacri pushed a commit to lucacri/orca that referenced this pull request Oct 31, 2026
lucacri pushed a commit to lucacri/orca that referenced this pull request Oct 31, 2026
lucacri pushed a commit to lucacri/orca that referenced this pull request Oct 31, 2026
lucacri pushed a commit to lucacri/orca that referenced this pull request Oct 31, 2026
lucacri pushed a commit to lucacri/orca that referenced this pull request Oct 31, 2026
lucacri pushed a commit to lucacri/orca that referenced this pull request Oct 31, 2026
lucacri pushed a commit to lucacri/orca that referenced this pull request Nov 1, 2026
lucacri pushed a commit to lucacri/orca that referenced this pull request Nov 1, 2026
lucacri pushed a commit to lucacri/orca that referenced this pull request Nov 1, 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