Ui/update-model-context Not Updating Model Context

Has anyone had issues with ui/update-model-context or app.updateModelContext not actually updating the model context?

The tool capabilities indicate that it is supported, and I see that when my widget calls updateModelContext, it is getting a successful response. However, when I try any further followup messages, the model doesn’t seem to be aware of anything that was sent via updateModelContext.

I have noticed this as well. Its very frustrating as its a core part of mcp apps. I had to code around this limitation essentially killing some features of my app.

I built a test app where the only action was to test to see if a secret string could be read out of chat through update model context and it was not working.

One thing to note is that I found if I refresh the page everything starts working. My theory is that there is some sort of race in the initialization code on the ChatGpts side of the message bridge.

Adding another data point because this looks very close to what I am seeing.

I have a ChatGPT Apps SDK / MCP app where the iframe publishes a very small active-selection context using `ui/update-model-context`. The browser console shows the outbound `ui/update-model-context` JSON-RPC message, the payload contains the current selected text/reference, and the host ACK comes back as `{}`. Network activity also follows the context update. So from the app side, the update appears to be sent and acknowledged.

The failure pattern is not simply “never works” for me:

  • after a full page reload, the first context-dependent follow-up usually works;
  • sometimes the second one works too;
  • after that, new context updates become unreliable: the model either says it cannot see the current selection, answers from stale context, or answers as if an older selection/page is still active;
  • refreshing/opening a fresh conversation can temporarily improve it again.

This is with tiny model context payloads, not large tool results. The model-facing context is basically “answer the user’s question based on this active reader context:” plus the selected phrase/reference. I also removed likely app-side confounders: passive viewport updates do not overwrite explicit selection, adjacent rendered pages publish their own page data, and the app-side debug trace shows the latest selection was the one sent.

Platform behavior is uneven. In current testing, Android ChatGPT behaves much more reliably. ChatGPT web, macOS desktop, and Windows desktop are the flaky ones. That makes this feel less like a pure app bug and more like a host/runtime/model-context bridge issue, possibly related to the live iframe / reload timing behavior mentioned above.

The hardest part is that there does not seem to be a way for the app to inspect the host’s stored model context after the ACK. We can prove the outbound update and ACK; we cannot prove whether ChatGPT actually attached that context to the next model turn except by asking the model and watching it fail.

If OpenAI has any recommended instrumentation for verifying the stored/attached model context after `ui/update-model-context`, that would help a lot. Right now the ACK can be successful while the next model turn behaves as if the context was dropped or stale.