Repository navigation
Conversation
…s own Embedded (configureEmbed), a screen that sent its tab to an app's sign-in sent the host app's page, and the vendor brought the person back to OpenBot's public address, where somebody signed in through the host has no session: a sign-in screen, out of the app they were using. - The API: returnTo window on connectApp, connectSharedApp and authorizeAction, a page that needs no sign-in and closes the tab the sign-in ran in, offered where getDeployment says windowConnections. - The web app, embedded: the sign-in opens in a tab claimed on the press (lib/plugins/consent-tab.ts), every connect asks for returnTo window where the server offers it, and the connection is read again once the person is back, as OpenBot Desktop's window does. Through Composio, OpenBot's step before the sign-in is left out when embedded: no page of OpenBot's runs on the host's origin to show it. Not embedded, nothing changes. - Docs: Connecting apps, under Embedded sign-in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…until connected From review: - returnTo window only while a tab claimed on the press is there for the sign-in. With none (the browser blocked it, or the page started the press itself) the sign-in opens in the host page, which a page that closes its tab could not close, so it comes back to OpenBot's own pages as before. A tab the person closed before the sign-in was ready opens a new one, never the host page. - Never for apps authorized action by action: that consent ends at OpenBot's verifier, which needs the person's session. - Embedded, a confirm answered "not connected" is asked again at the next return, for up to fifteen minutes, so coming back to the host page before finishing no longer loses the account. - Admin's app page claims only for an app reached as you, and lets go of the tab where reading the catalogue fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
davidmckayv
left a comment
There was a problem hiding this comment.
The security side is right, but one gap blocks this: only some of the ways in are fixed.
I checked the redirect and the closing page and found no problems:
- The return is a fixed page the server chooses, never an address.
- The closing page reads one flag, reflects nothing and runs under a strict CSP.
- There's no postMessage, and the opener is cut before the tab navigates, so no code or state reaches the host page.
- The spec change only adds things, and the clients are regenerated.
- Outside embedded mode, nothing changes.
Must fix
-
useConnectInNewTabopens its own tab withwindow.openand never registers it inheld(app/src/lib/plugins/consent-tab.ts:56-62). SoconnectsInWindowis false for every press that goes through it, and those requests still sendreturnTo: connections. That covers:- the chat connect cards (
connect-app-card.tsx,another-account-card.tsx) app-access-action.tsx- Browse apps (
use-directory-press.ts)
Embedded, those tabs end on
/connections/<key>with no session, which is a sign-in screen.markConnectReturncan't rescue it either, because it writes to the blank tab's sessionStorage on the host's origin.Fix: register the claimed tab in
held(export a hold/release fromconsent-tab.ts), and add a test that a chat card's connect sendswindowwhen embedded. - the chat connect cards (
Nits, not blocking
-
consent-tab.ts:111-120has three gaps:- a blocked reopen after the person closed the tab fails silently;
connectsInWindowcounts tabs held by any screen, whilegouses only its own;- a screen that unmounts mid-press leaves its tab held.
Tie the
windowdecision to the screen's own tab, and drop the tab on unmount. -
docs/configuration.md:837: a sandboxed frame needsallow-popups-to-escape-sandboxas well asallow-popups, or vendor sign-in pages break. -
confirm-on-return.ts:111: putting an entry back after the awaits can overwrite a newer press. For 15 minutes after an unfinished consent, every focus reloads every plugin list, so consider a backoff. -
Embedded, the notice before a Composio sign-in is skipped. That drops a step people get today. A Continue-only dialog would keep it.
-
Embedded, Add custom MCP opens and closes a blank tab even for a server that needs no sign-in.
-
The success heading says "signed in to the app". Our word is "connect": "Connected".
-
Out of scope, but worth knowing: the GitHub identity link (
linked-accounts.tsx:228) still takes over the host page when embedded.
CI: the WebKit shards were still running at review time.
…he closing page too From Dave's review of this PR: - useConnectInNewTab claims its own tab and never registered it as held, so a chat card's connect, Browse apps and an app's access row still asked for OpenBot's own pages and landed on a sign-in screen when embedded. Its tab is now held (holdConsentTab) until it is sent to the sign-in or closed. Test: an embedded chat card's connect sends returnTo window. - A screen that goes lets go of the tab it claimed. - A confirm put back for the next return never replaces a newer press for the same app. - Docs: a sandboxed frame needs allow-popups-to-escape-sandbox as well as allow-popups. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
davidmckayv
left a comment
There was a problem hiding this comment.
The chat cards, Browse apps and app access now hold their tab too, so every way in asks for the closing page. Approving.
- All four new-tab entry points open their tab through one claim that holds it, and every way out of the press lets it go. Outside embedded mode, nothing changes.
- The new card test would fail without the hold, because the connect would still send
connections. - Screens now let go of their tab when they go, a confirm that's put back can't replace a newer press for the same app, and the sandbox note now includes
allow-popups-to-escape-sandbox. - One edge for later: if you reach Admin's app page through a reconnect, it moves to the reconnect page before the sign-in, so that sign-in no longer has a held tab.
Merge once CI is green. It goes in 1.2.10.
Why
Embedded in another app's page (
configureEmbed), every screen that starts an app's sign-in didwindow.location.href = authorizationUrl. That sent the host app's own page to the vendor. The vendor then brought the person back to OpenBot's public address, where somebody signed in through the host has no session, so they ended on a sign-in screen, out of the app they were using.What changes
API (additions only):
ConnectionReturnToandSharedConnectionReturnTogainwindow: a page that needs no sign-in and closes the tab the sign-in ran in. It applies toconnectApp,connectSharedAppandauthorizeAction.getDeploymentgainswindowConnections. A client sendswindowonly where the server says so, as withmobileandmobileConnections.Web app, embedded only:
lib/plugins/consent-tab.ts: the sign-in opens in a tab claimed on the click, because a browser only allows one while the click is recent and asking the server for the address comes first. The opener is severed, so the vendor's page can't reach the host page. If the tab is blocked, the sign-in still opens in the page, as before.returnTo: windowonly when all of these hold:confirmOnReturn). Embedded, a confirm answered "not connected" is asked again at the next return, for up to fifteen minutes, because the person may come back to the host page before they finish in the other tab.Not embedded, nothing changes.
claimdoes nothing, andgosends the page to the sign-in exactly as before.Docs: "Connecting apps" under Embedded sign-in, including that a sandboxed frame around the host page needs
allow-popups.Changelog
Apps.
API.
returnTo: windowonconnectApp,connectSharedAppandauthorizeAction, andwindowConnectionsongetDeployment. A client asks forwindowonly where the server offers it.Tests
app/tests/embedded-consent-window.test.ts(15):window.connectionsandapps, as before.window.returnToand scan tests failed before the change.api:generateleaves nothing changed,api:lintis valid, andoasdiff breakingreports no breaking changes.🤖 Generated with Claude Code