Android ChatGPT app: MCP tool widget disappears after ChatGPT confirmation popup, with destroyed WebView warning

Summary

In the Android ChatGPT app, an MCP tool-generated UI widget disappears immediately after the MCP tool response is returned.

This happens in a flow where the ChatGPT app displays its own user confirmation popup for a product-control action. After the user confirms the action, the widget is rendered again, but disappears when the MCP tool response is returned.

At the same time, logcat shows that the app attempted to call evaluateJavascript() on a destroyed WebView.

Reproduction Steps

  1. Open the Android ChatGPT app.

  2. Trigger a product-control action that generates a tool UI widget.

  3. The ChatGPT app displays its own user confirmation popup for the requested control action.

  4. Confirm the action.

  5. The widget is rendered again.

  6. When the tool response is returned, the widget disappears.

Actual Behavior

The widget disappears after the tool response.

The following warning appears in logcat:

W cr_AwContents: Application attempted to call on a destroyed WebView
java.lang.Throwable
    at com.android.webview.chromium.WebViewChromium.evaluateJavaScript(...)
    at android.webkit.WebView.evaluateJavascript(WebView.java:898)
    at m3d.run(...)

Expected Behavior

The widget should remain visible and update normally after the tool response is returned.

The app should not call evaluateJavascript() on a destroyed WebView.

Suspected Cause

This may be a WebView lifecycle race condition.

A possible sequence is:

Tool widget is created
→ ChatGPT confirmation popup appears
→ Existing widget WebView is destroyed or detached
→ Widget is re-rendered
→ Tool response arrives asynchronously
→ App tries to dispatch JavaScript to the old destroyed WebView
→ Widget disappears or fails to update

Request

Could the Android ChatGPT team investigate whether the tool widget host is holding a stale WebView reference after the confirmation flow?

This issue seems related to calling evaluateJavascript() on a WebView that has already been destroyed.

@OpenAI_Support Could you please help verify this issue?
The issue does not occur on the Chrome web browser on PC, the ChatGPT app on iPhone, or the Chrome web browser on Android devices; it occurs only on the ChatGPT app for Android.
If the issue cannot be confirmed, it may be challenging for us to submit the Apps SDK–based app that is currently under development for review.