External Publication
Visit Post

Production update workflow, widget URIs, cache keys - best practices

OpenAI Developer Community May 5, 2026
Source

Thanks for these responses.

Here is what worked for me. A stable URI in tools/list going forward, plus a ResourceTemplate catching legacy versioned URIs, all resolving to current widget HTML.

server.registerResource('show_venues', 'ui://widget/show-venues.html', {}, handler);

server.registerResource(

'show_venues-legacy',

new ResourceTemplate('ui://widget/show-venues-{version}.html', { list: undefined }),

{},

handler,

);

The template absorbs cached clients still pinned to old versioned URIs - this immediately fixed my production app.

Worth noting: my previous setup did bake a per-build version into every advertised URI. The clean version of that pattern — retain all old widget HTML and the static chunks each version references — is hard in Next.js (which is what I’m in). Every next build regenerates the _next/static/ hashes, so old HTML pointing at old chunks 404s after the next deploy. Stable URI + template catch was the pragmatic path.

My plan is when I make changes that aren’t backward-compatible (parameter shape, behavior), I’ll bump to a new URI, keep the old URI registered against the old handler, and only advertise the new one in tools/list. Old chats pinned to the old URI keep working with the old code; new chats get the new contract.

This is assuming tools/list is snapshotted at submission and only updated on approved resubmission… which I’m pretty sure is the case but if anyone knows otherwise please share!

Thanks again!

Discussion in the ATmosphere

Loading comments...