From 6f48457a083bd9a0290c3150b9e8043447fa2b3d Mon Sep 17 00:00:00 2001 From: Liad Yosef Date: Sun, 25 Jan 2026 16:34:05 +0200 Subject: [PATCH] fix(docs): improve OpenAI migration guide accuracy - Add missing setOpenInAppUrl API to 'Not Yet in MCP Apps' section - Clarify Event Handling table: specify exact OpenAI properties (toolInput/toolOutput) instead of vague 'window.openai.*' - Improve notes to distinguish sync property reads vs callbacks Co-Authored-By: Claude Opus 4.5 --- docs/migrate_from_openai_apps.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/migrate_from_openai_apps.md b/docs/migrate_from_openai_apps.md index 3092f516..6f5a1c32 100644 --- a/docs/migrate_from_openai_apps.md +++ b/docs/migrate_from_openai_apps.md @@ -291,16 +291,17 @@ Client-side migration involves replacing the implicit `window.openai` global wit | ------------------------------------------- | -------- | ------------------- | | `await window.openai.requestModal(options)` | — | Not yet implemented | | `window.openai.requestClose()` | — | Not yet implemented | +| `window.openai.setOpenInAppUrl({ href })` | — | Not yet implemented | | `window.openai.view` | — | Not yet mapped | ### Event Handling -| OpenAI | MCP Apps | Notes | -| ------------------------------ | ------------------------------------------- | -------------------------------- | -| Read `window.openai.*` on load | `app.ontoolinput = (params) => {...}` | Register before `connect()` | -| Read `window.openai.*` on load | `app.ontoolresult = (params) => {...}` | Register before `connect()` | -| Poll or re-read properties | `app.onhostcontextchanged = (ctx) => {...}` | MCP pushes context changes | -| — | `app.onteardown = async () => {...}` | MCP adds: cleanup before unmount | +| OpenAI | MCP Apps | Notes | +| --------------------------------------------- | ------------------------------------------- | ------------------------------------------------------------------ | +| `window.openai.toolInput` (read on load) | `app.ontoolinput = (params) => {...}` | OpenAI: sync property; MCP: callback (register before `connect()`) | +| `window.openai.toolOutput` (read on load) | `app.ontoolresult = (params) => {...}` | OpenAI: sync property; MCP: callback (register before `connect()`) | +| `addEventListener("openai:set_globals", ...)` | `app.onhostcontextchanged = (ctx) => {...}` | Both push updates; MCP uses callback, OpenAI uses DOM event | +| — | `app.onteardown = async () => {...}` | MCP adds: cleanup before unmount | ### Logging