Codex Desktop: multi-tab IAB finalize with an empty keep list terminates browser helper and backend
Summary
On Windows Codex Desktop, using the multi-tab in-app browser and calling browser.tabs.finalize({ keep: [] }) as the final browser operation returned success with sessionEnded: true. Immediately afterward, both the Browser Use helper and the Codex backend processes disappeared. The tested local web application and its Vite process remained healthy.
This appears to be a Codex in-app-browser lifecycle teardown defect, not a webpage or application crash.
Environment
- Codex Desktop Appx:
26.721.4979.0x64 - Bundled Browser Use client/plugin:
26.721.41059 - Bundled Codex CLI:
0.146.0-alpha.3.1 - Windows x64, version
25H2, build26200.8875 - Browser backend: multi-tab IAB
Observed sequence
- Browser Use operated normally against a localhost Vite application.
- The final browser operation called
browser.tabs.finalize({ keep: [] }). - The operation returned successfully and reported
sessionEnded: true. - At approximately
2026-07-26 03:27:09 CEST(01:27:09 UTC), the Browser Use helper and main Codex backend disappeared. - There was no graceful-shutdown, panic, fatal, or handled-error record after the final tool-item completion.
- Windows produced no Application Error, WER event, or crash dump.
- The localhost application and Vite process stayed up and logged no product error.
The operation has deliberately not been repeated because it takes down the active Codex session.
Local log correlation
- Browser helper's final recorded activity: approximately
01:27:00 UTC. - Main Codex backend's final record: tool item completed at
01:27:08.5846594 UTC. - No subsequent graceful process-exit record exists.
No customer data, credentials, repository contents, or local absolute paths are included in this report.
Packaged implementation observations
Read-only inspection of the installed package shows:
- The browser API documentation marks
Tabs.finalizeunsupported by default for IAB. - Multi-tab IAB explicitly overrides the capability and advertises
Tabs.finalize: true. - The browser client detaches all controlled tabs before calling the host finalizer and then unconditionally publishes
sessionEnded: trueafter success. - The IAB host finalizer closes or releases session tabs, marks all Browser Use hosts inactive, and clears the recorded Browser Use turn.
- Codex's normal turn-end lifecycle contains substantially overlapping browser cleanup.
- The desktop handler observed for
sessionEnded: trueinvalidates browser presentation state; it does not itself explicitly terminate the backend.
This suggests a race or non-idempotent lifecycle transition between explicit session finalization and normal turn completion. The exact lower-level exit path is not logged, so that final step remains an inference.
Expected behavior
Tabs.finalize should close or release the intended browser resources and return while leaving the Browser Use helper and Codex backend alive. A subsequent non-browser tool call and a new Browser Use session should both work.
Suggested remediation
Either:
- Stop advertising
Tabs.finalizefor IAB and rely on the normal turn-end cleanup; or - Make IAB finalization serialized and idempotent so concurrent or repeated turn cleanup cannot terminate shared processes.
Regression coverage
For multi-tab IAB:
- Start a browser session with agent-created and user-owned tabs.
- Invoke finalization with an empty keep allowlist as the final tool item.
- Verify the Codex backend and Browser Use helper remain alive.
- Verify user-owned tabs are released rather than closed.
- Verify a subsequent non-browser tool succeeds.
- Verify a new IAB browser session can start.
- Repeat finalization or overlap it with turn completion and verify it becomes a safe no-op.
Related but not identical lifecycle/ownership reports: #21824 and #35231.
2 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I can confirm this still reproduces on a newer Windows build.
Environment
26.803.5235.0x6426.803.4151510.0.26200.0Reproduction
browser.tabs.finalize({ keep: [] }).This reproduced twice on 2026-08-07 at approximately 21:03:27 and 21:26:32 Asia/Shanghai (13:03:27 and 13:26:32 UTC).
In both desktop logs, the final lifecycle sequence is:
unregistered debugger listenerwithreason=manualrenderer disposed browser sidebar webviewbrowser sidebar guest torn downclosed browser sidebar pageaction=closedThe log then ends abruptly without a graceful shutdown entry. Windows recorded no matching Application Error/WER event, no new crash dump, and no resource-exhaustion event.
Nearby warnings include:
[browser-use-pip] Failed to upsert Browser Use PiP contentResizeObserver loop completed with undelivered notificationsThose warnings are correlated in time but are not necessarily the root cause.
No full logs or session transcript are attached because they may contain workspace/thread metadata. The complete local logs are retained and can be provided after sensitive-data review if an OpenAI maintainer requests specific excerpts.