Title: fix(mcp): deliver OAuth callback result over BroadcastChannel so COOP can't strand the connect by waleedlatif1 · Pull Request #5767 · simstudioai/sim · GitHub
Open Graph Title: fix(mcp): deliver OAuth callback result over BroadcastChannel so COOP can't strand the connect by waleedlatif1 · Pull Request #5767 · simstudioai/sim
X Title: fix(mcp): deliver OAuth callback result over BroadcastChannel so COOP can't strand the connect by waleedlatif1 · Pull Request #5767 · simstudioai/sim
Description: Summary Debugged a live staging report: connecting an OAuth MCP server (Gauge, https://app.withgauge.com/mcp) hangs on "Connecting…" forever. AWS logs showed the OAuth round-trip completing (/oauth/start 200, user authorized, /oauth/callback hit) but the UI never updating. Root cause: Gauge's authorization page sends Cross-Origin-Opener-Policy: same-origin. Per MDN, that sets window.opener = null for the cross-origin popup, so the callback's window.opener.postMessage was silently dropped — the parent never learns the flow finished. Our page already uses same-origin-allow-popups, but that doesn't help when the provider's page forces same-origin. Fix: deliver the completion over a same-origin BroadcastChannel instead of window.opener.postMessage. BroadcastChannel is origin-scoped and COOP-immune by design — the documented workaround for exactly this. The message is scoped by workspaceId so a concurrent flow in another open workspace is ignored. Also: log every OAuth callback failure (reason + serverId). The early-return gates previously returned a silent ok:false popup close, so a failed authorization couldn't be diagnosed from server logs. (Separately, the reported attempt's callback returned in 11ms — an early-gate failure before token exchange; this logging makes that reason visible on the next attempt.) Type of Change Bug fix Testing Added callback-route tests: success signals over the BroadcastChannel scoped to server + workspace; an early failure reports over the channel without attempting token exchange. tsc, Biome, and 40 MCP OAuth tests pass. Note: the end-to-end popup behavior needs a live OAuth smoke test on staging (COOP severance only reproduces in a real browser against a same-origin provider). Out of scope (deliberately not changed) Kept the callback's awaited tool discovery (guarantees status+tools are ready when the signal fires — no UI flicker); making it non-blocking is a separate change with frontend-coordination implications. Did not touch the popup-open timing; the popup opens fine today (the failure was completion signalling, not opening). Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)
Open Graph Description: Summary Debugged a live staging report: connecting an OAuth MCP server (Gauge, https://app.withgauge.com/mcp) hangs on "Connecting…" forever. AWS logs showed the OAuth round-trip complet...
X Description: Summary Debugged a live staging report: connecting an OAuth MCP server (Gauge, https://app.withgauge.com/mcp) hangs on "Connecting…" forever. AWS logs showed the OAuth round-trip...
Opengraph URL: https://github.com/simstudioai/sim/pull/5767
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:b8c8c4e5-1427-ba48-a115-2f36f62e048c |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9690:1BAFD1:887EC7:C3C5FA:6A638065 |
| html-safe-nonce | df7c0fe9f15c921a3019efc090a19c94604ba627f98b1d9ea01264ffdcaab853 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjkwOjFCQUZEMTo4ODdFQzc6QzNDNUZBOjZBNjM4MDY1IiwidmlzaXRvcl9pZCI6IjUxMjQ1OTk0NzU3ODYxODY4NTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0633768c0b9fffbc4bc1b6ebcde0153dc2ae913bddd79de80e07e13dbdd4fd66 |
| hovercard-subject-tag | pull_request:4086473434 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/5767/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary Debugged a live staging report: connecting an OAuth MCP server (Gauge, https://app.withgauge.com/mcp) hangs on "Connecting…" forever. AWS logs showed the OAuth round-trip complet... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | e4fb64aef87da454ec25b158147f7f5f14aef29216e5ca1612c2e48faa599d1f |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e839936ba5faffb9c836dda1cf4729d50c88a32e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width