Android ChatGPT app: Tool widget disappears after confirmation, with destroyed WebView warning
Summary
In the Android ChatGPT app, a tool-generated UI widget disappears immediately after a tool response is returned.
This happens in a flow where the user confirms a product-control action through a ChatGPT confirmation popup. Around the same time, logcat shows that the app attempted to call evaluateJavascript() on a destroyed WebView.
Reproduction Steps
Open the Android ChatGPT app.
Trigger a product-control action that generates a tool UI widget.
The ChatGPT app displays its own user confirmation popup for the requested control action.
Confirm the action.
The widget is rendered again.
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.
Discussion in the ATmosphere