Confirming this, with the underlying cause and a partial workaround — we chased it all day today.
**Reproduced** on two unrelated apps with different widgets, on conversations both minutes and days old. Live renders are fine; only refresh / revisit breaks. The same apps rehydrate correctly in another MCP Apps host.
**What actually happens.** We instrumented our renderer to report the shape of the tool result it receives (keys only). On a refresh of a conversation that rendered correctly seconds earlier:
- `content` is still there, with a `text` block — but the block parses to an **empty object** (`{}`)
- `structuredContent` is there too, and is **also empty**
- there is no `_meta` on the replayed result
A caution for anyone testing: a check like `if (result.structuredContent)` passes on `{}`. We wasted hours believing structuredContent survived. **Count the keys.**
Intermittently the widget’s `ontoolresult` does not fire at all and the widget just sits on its initial state — matching openai/openai-apps-sdk-examples#195. Same conversation, different reloads, different behaviour.
**Partial workaround that got our UI back.** Put the widget’s markup in the `ui://` resource that `outputTemplate` points at, rather than shipping it inside the tool result. The template pointer *is* persisted and re-fetched on reload, so the UI reliably returns. This is the canonical arrangement anyway — worth doing regardless of the bug.
That fixes the UI, not the data. Since neither carrier survives, our widget now re-requests its data from our own server when it mounts with none. If you do the same, gate it: re-running a tool on mount can re-trigger side effects, so restrict it to read-only tools that take no arguments — otherwise reopening a chat can silently repeat an action.
One gotcha: the resource pointer is resolved when the app is connected, so a change like this only takes effect after the app is refreshed in ChatGPT (app page → ⋯ → Manage → Refresh). Existing conversations keep the old pointer until then.
Related: openai/openai-apps-sdk-examples#195 and #144.