You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
session-stream.ts (409 L): createAiSdkBackendFactory (the whole backends.register('ai-sdk') closure incl. modelSupportsVision, contract text verbatim) + createSessionStreamer.
Semantics preserved with care: the register call SITE stays at its original position (registry-construction order); module-let mutations (runtime, lookupPricing) injected as accessors so both snapshot-read and live-read closures keep exact behavior; 9 streamEvents call sites untouched in main.ts.
Contracts: modules added to the main-process source aggregator; attachment-frontend (vision pin), ipc-surface, web-search-telemetry-scrub switched to combined-source with every assertion kept; wiring-contract (registerIpc anchor) untouched; one console allowlist path updated.
Proof: auditor boots all 11 fixtures clean; CDP turn-narrative renders the full chat hot path; settings-general renders 65 controls.
Gates (merged tree): desktop 2744 · ui 196 · typecheck · check-dead-css · knip ×2 = 0. Implemented by an opus worktree agent; R6 boundary shifted −284 in the map.
Pure move of main.ts's settings runtime-effects cluster into
settings-runtime-effects.ts, exporting createSettingsRuntimeEffects(deps)
→ { normalizeSettingsPatch, applySettingsRuntimeEffects,
handleExternalSettingsChange } (syncDefaultPermissionModeToSessions stays
internal). Follows the R4 tool-assembly / tool-artifact-persistence DI
precedent: settingsStore / botRegistry / openGateway / keepSystemAwake /
runtime / safeSendToRenderer / emitSessionsChanged are injected, bodies
byte-identical. keep-awake runtime-effect (#1207) rides
applySettingsRuntimeEffects unchanged.
Contract mechanics: add settings-runtime-effects.ts to the
main-process-contract-source-helpers aggregator; allowlist the moved
[config-watcher] console.error at its new path in check-console.mjs. No
source-pin test targeted these functions in main.ts directly.
Pure move of main.ts's session-stream cluster into session-stream.ts:
- createAiSdkBackendFactory(deps): BackendFactory — the whole
backends.register('ai-sdk', …) closure plus the internal modelSupportsVision.
Two seams resolved after the registration point are injected as accessors:
getRuntime (SessionManager built later) and getLookupPricing (mutable pricing
lookup, read live per recordLlmCall / snapshotted once for the lookupPricing
field — matching the original module-let closure semantics exactly).
- createSessionStreamer(deps): StreamEvents — streamEvents + its two
event-classifier helpers and the StreamEventsOptions/Result types.
main.ts keeps the module-scoped seams it owns (backends.register call site,
sessionActivities, lookupPricing let, runtime, the fake/e2e backend registers)
and every streamEvents call site.
Contract re-pins (maintainer-authorized): add session-stream.ts to the
main-process-contract-source-helpers aggregator; switch three direct-main.ts
readers to the combined source keeping every assertion —
attachment-frontend-contract (modelSupportsVision + supportsVision vision pin),
ipc-surface-contract (memoryPromptSnapshot + buildBackendSystemPrompt),
web-search-telemetry-scrub-contract (argsSummary scrub). registerIpc /
main-process-wiring-contract untouched.
main.ts 1656 → 1372 (−284 across both R5 clusters).
…it (#1250)
R5 (#1248) moved the isComputerUseRealModelE2e tool/economy branches from
main.ts into session-stream.ts and repinned three main-process contract
tests to the combined source, but missed scripts/cu-real-model-launcher.test.mjs,
which still read main.ts alone. Its `Desktop isolation gate does not enable
FakeBackend` case then failed the `? computerUseTools` and
`? { economy: false, groups: [] }` matches, turning main CI red.
Scan main.ts + session-stream.ts together (same follow-the-split shape as
the R5 contract repins) so the isolation-gate pins follow the extracted
module. Test-only; no production code changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Round 5 of notes/frontend-architecture-map-2026-07-19.md: main.ts 1656 → 1372 (−284), both clusters extracted in full (no escape hatch needed).
Gates (merged tree): desktop 2744 · ui 196 · typecheck · check-dead-css · knip ×2 = 0. Implemented by an opus worktree agent; R6 boundary shifted −284 in the map.