Codex Desktop: multi-tab IAB finalize with an empty keep list terminates browser helper and backend

Open 💬 2 comments Opened Jul 26, 2026 by TheCheesen1
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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.0 x64
  • Bundled Browser Use client/plugin: 26.721.41059
  • Bundled Codex CLI: 0.146.0-alpha.3.1
  • Windows x64, version 25H2, build 26200.8875
  • Browser backend: multi-tab IAB

Observed sequence

  1. Browser Use operated normally against a localhost Vite application.
  2. The final browser operation called browser.tabs.finalize({ keep: [] }).
  3. The operation returned successfully and reported sessionEnded: true.
  4. At approximately 2026-07-26 03:27:09 CEST (01:27:09 UTC), the Browser Use helper and main Codex backend disappeared.
  5. There was no graceful-shutdown, panic, fatal, or handled-error record after the final tool-item completion.
  6. Windows produced no Application Error, WER event, or crash dump.
  7. 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.finalize unsupported 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: true after 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: true invalidates 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:

  1. Stop advertising Tabs.finalize for IAB and rely on the normal turn-end cleanup; or
  2. Make IAB finalization serialized and idempotent so concurrent or repeated turn cleanup cannot terminate shared processes.

Regression coverage

For multi-tab IAB:

  1. Start a browser session with agent-created and user-owned tabs.
  2. Invoke finalization with an empty keep allowlist as the final tool item.
  3. Verify the Codex backend and Browser Use helper remain alive.
  4. Verify user-owned tabs are released rather than closed.
  5. Verify a subsequent non-browser tool succeeds.
  6. Verify a new IAB browser session can start.
  7. 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.

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 1 month ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #35210

Powered by Codex Action

ysydoublefish · 20 days ago

I can confirm this still reproduces on a newer Windows build.

Environment

  • Codex Desktop Appx: 26.803.5235.0 x64
  • Bundled in-app Browser/plugin release visible in the app logs: 26.803.41515
  • Windows x64, OS version 10.0.26200.0
  • Browser target: a localhost NiceGUI application

Reproduction

  1. Use the in-app Browser normally (navigation, DOM inspection, viewport changes, and screenshots all work).
  2. End the browser run with browser.tabs.finalize({ keep: [] }).
  3. Codex Desktop exits immediately.

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 listener with reason=manual
  • renderer disposed browser sidebar webview
  • browser sidebar guest torn down
  • closed browser sidebar page
  • browser tab lifecycle action=closed

The 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 content
  • repeated ResizeObserver loop completed with undelivered notifications

Those 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.