Skip to content

fix(ui): restore ChatGPT cards after revisit - #210

Closed
UnlastingR wants to merge 4 commits into
Waishnav:mainfrom
fyzure:fix/chatgpt-card-rehydration
Closed

fix(ui): restore ChatGPT cards after revisit#210
UnlastingR wants to merge 4 commits into
Waishnav:mainfrom
fyzure:fix/chatgpt-card-rehydration

Conversation

@UnlastingR

@UnlastingR UnlastingR commented Aug 19, 2026

Copy link
Copy Markdown

ChatGPT can remount a historical DevSpace widget without replaying the original MCP tool-result event. In that path the iframe starts with no card and stays on Waiting for a tool result., which matches the historical-widget behavior reported in #74 and can leave many dead-looking widgets behind in long conversations.

This persists the complete DevSpace card snapshot in ChatGPT widget state, restores it during widget boot, and falls back to ChatGPT's historical toolOutput / toolResponseMetadata globals when no persisted snapshot is available. It also listens for openai:set_globals in case those globals arrive after boot. The widget resource URI is versioned and the ChatGPT openai/outputTemplate alias is advertised so existing template caching does not keep serving the older bootstrap behavior.

The regression coverage checks widget-state round trips, malformed-state rejection, historical-global rehydration, precedence of persisted state, and the tool metadata used by ChatGPT. The portable MCP Apps path remains unchanged when the ChatGPT-specific bridge is unavailable.

Summary by CodeRabbit

  • New Features

    • Added persistence for workspace result cards, allowing cards to be restored when reopening or reconnecting to the app.
    • Preserves card content and state across host updates, prioritizing saved state during conflicts.
    • Added compatibility for restoring cards from supported host-provided tool results.
    • Improved compatibility with ChatGPT-hosted workspace widgets.
  • Bug Fixes

    • Invalid or incomplete saved card data is safely ignored so the workspace continues rendering normally.
    • Improved validation prevents malformed card content from being displayed.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant