Repository navigation
fix(linux): prevent IAB_LIFECYCLE sidebar rebound loop (windowId-based lookup) - #486
Merged
ilysenko merged 2 commits intoJun 13, 2026
Merged
Conversation
…d lookup) Replace the 'first live window' heuristic in codexLinuxResolveLiveBrowserUseRouteWindow() with a direct BrowserWindow.fromId(windowId) lookup. The old heuristic eagerly bound to whatever single window existed during startup, then broke when hidden windows appeared, causing sidebar destroy+recreate rebound cycles and text overlap/ghosting. Fixes ilysenko#485
ilysenko
approved these changes
Jun 13, 2026
ilysenko
left a comment
Owner
There was a problem hiding this comment.
Reviewed current head bc1c6ea. The runtime change now has targeted route-window lookup coverage: exact windowId resolves, unrelated single live windows are not used. Local focused patcher suite passed (244/244), and GitHub checks are green.
No1Hoo
pushed a commit
to No1Hoo/codex-desktop-linux
that referenced
this pull request
Jun 18, 2026
The previous PR ilysenko#486 fixed function IJ (route window resolver) to use BrowserWindow.fromId(windowId) instead of a "first live window" heuristic. However, a second function LJ (focused owner resolver) introduced in newer DMG versions still uses getAllWindows().filter().length===1 — the same class of bug. When hidden Electron windows (crashpad, gpu, clipboard) exist, the length===1 shortcut returns the wrong window, triggering an infinite IAB_LIFECYCLE rebound loop on the sidebar. This patch: - Adds codexLinuxResolveFocusedOwnerWindow() helper (depth 0) - Removes the getAllWindows().length===1 shortcut from LJ - Uses lastSyncedWindowId via getLiveWindowState for precise lookup - Falls back to iterating the windows Map (same as original, minus the bug)
This was referenced Nov 19, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
codexLinuxResolveLiveBrowserUseRouteWindow()uses a "first live window" heuristic instead of matching the requestedwindowId. During Electron startup when the main window is the only one, this eagerly binds to it, then hidden windows appear and IAB_LIFECYCLE enters a destroy+recreate rebound loop → sidebar text overlap/ghosting.Fixes #485
Change
Replace the heuristic with a direct
BrowserWindow.fromId(windowId)lookup — the function now correctly uses thewindowIdparameter it was already receiving:getAllWindows()→ if exactly 1 → force bind (regardless of windowId)fromId(windowId)→ if live → create state from it; otherwise check state map by idTested