Repository navigation
fix(web): agent tabs in background threads open in the desktop browser - #19919
Conversation
The desktop only loaded preview tabs for threads whose chat was on screen. A tab an agent opened in a background thread never got a webview, so after 10 s the server fell back to its headless browser, whose software-rendered GPU process can use several cores. The always-mounted browser host now follows the environment's preview events and starts the existing per-thread sync for each thread that opens a tab, so the desktop renders it. Refs pingdotgg#18165, pingdotgg#16901 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedOnly developers with an assigned seat can use this organization's usage-based review budget, and seats here are assigned manually. Ask an admin to assign a seat, or change the review continuation mode in Billing. Next included review available in 23 minutes. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
Taking over this one. I will integrate current main, rebuild the focused background preview discovery path, and verify desktop attachment before pushing the reviewed update to this branch. |
…-webview # Conflicts: # apps/web/src/browser/ElectronBrowserHost.tsx
# Conflicts: # apps/web/src/browser/ElectronBrowserHost.tsx # packages/client-runtime/src/state/runtime.test.ts
Agent-created preview tabs in background threads had no desktop host until their chat mounted. The desktop host now discovers threads from the primary environment's preview events and mounts the existing per-thread session sync. Chat and desktop share that sync, including list reconciliation and tab closure. The shared preview event subscription also delivers each event separately to the atom, so a batch cannot hide an earlier thread open or tab close.
This finishes @MahirAbbas's original contribution, preserves the contributor's commits, and merges main at ab6be13d43 to resolve the conflict.
Verification at 68c1401c:
Before — discovery disabled in the production host, with otherwise matching fixture/data/viewport:
After — reviewed head:
Limits: this native integration fixture is not the packaged T3 desktop app. It substitutes transport, settings/permissions, and unexercised UI boundaries; it does not prove the full server fallback transition or CPU reduction. Previously existing tabs still need a subsequent event or chat mount for discovery, and discovered thread syncs live for the desktop host's lifetime. A close for an undiscovered preexisting thread can still leave old cached tabs after chat unmounts; this predates this fix and is outside its discovery scope. macOS, Windows, iOS, Android, packaged Electron, and remote/relay/tunnel flows were not verified. Web and mobile do not mount this Electron-only host; provider adapters and wire contracts are unchanged.
Maintainer work: Codex harness, gpt-6.1-sol; fresh tests: Codex gpt-6-astra; reviews: Codex gpt-6-sol and Claude claude-opus-5-5.