Repository navigation
Show the Composio step in OpenBot Desktop's window before the browser opens - #1758
Merged
Merged
Conversation
davidmckayv
requested review from
MikeRyanDev,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
November 17, 2026 09:22
… opens A sign-in started from Browse apps, a Bot's Apps page or a Bot's Connect card goes through useConnectInNewTab, which skipped the step whenever it ran in the Desktop window, because the step's own page has nowhere to open there. So the browser opened straight on Google's sign-in. In the Desktop window the step is now a dialog in the window. The tab the window hands out is held while it counts down, and at 0 or on Continue now it is pointed at the sign-in exactly as before. Cancel opens nothing. In a browser nothing changes. The browser test gains a Desktop block that loads the page as the shell does: a loopback origin, Tauri's internals and the shell's own outside-links shim, with the consent route standing in for the window's guard.
brokeredConsentFor read the app list again from the server at every press. When that read failed, or was cancelled by another refetch it had joined, the step was dropped and the sign-in opened straight away, on Gmail's own page too. The screen that drew Connect already holds how apps are set up and which apps there are, so the step now decides from those, and reads the list again only for an app the screen has not seen yet (one Browse apps has just added).
davidmckayv
force-pushed
the
fix/consent-step-in-desktop
branch
from
November 17, 2026 15:10
9b6d8c6 to
9f6fde7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hold merge: needs Mac and Windows Desktop passes on this head.
What was wrong
In OpenBot Desktop, the step OpenBot shows before a Composio sign-in ("Connecting Gmail", why Composio, "Taking you to Google in 5") was skipped, and the person's browser opened straight on Google's sign-in. Two separate things did it.
1. Browse apps, a Bot's Apps rows and a Bot's Connect card skipped it on purpose, on every platform
Every one of those starts through
useConnectInNewTab(app/src/components/plugins/connect-in-new-tab.ts), which turned the step off whenever it ran in the Desktop window:The reason given was that the window opens no tab of its own, so the step's own page (
/connecting) had nowhere to show. That is true of the page, but nothing put the step anywhere else, so Desktop got no step at all. This matches Browse apps' Add skipping it on both Mac and Windows.2. Any app's page skipped it when the press-time re-read of the apps failed
The Connections page for an app (Connect, Connect another account, Reconnect) does show the step in Desktop, but only if
brokeredConsentFor(app/src/lib/plugins/consent-handoff.ts) answers. It asked the server for the whole app list again at every press, and any failure of that one read (an error, or a refetch it had joined being cancelled by another invalidation) answered null, and null means "open the sign-in straight away". Nothing on the code path branches on WebKit or WebView2; the read is timing-dependent, which fits it showing on one machine and not another.brokeredConsentForanswers correctly when the read succeeds: for the personal edition's Gmail the app setup sayscomposioand the app's source isdirectory.What changed
useConnectInNewTabnow shows the step as a dialog in the Desktop window. The tab the window hands out (the outside-links stand-in) is held while the dialog counts down. At 0 or on Continue now it is pointed at the sign-in exactly as before, so the window's guard opens the person's browser as it always did. Cancel closes it and opens nothing.consentStep, and the three places that draw its buttons render it: Browse apps, a Bot's Apps rows (AppAccessAction) and the Connect card in chat.brokeredConsentFordecides from what the screen already holds: how apps are set up and the app list the screen that drew Connect read. It reads the list again only for an app the screen has not seen (one Browse apps has just added)./connectingat all.Tests
app/tests/consent-handoff.test.tsxgains a Desktop block, run in Chromium (WebView2's engine) and WebKit (WKWebView's engine). The page is set up as the real shell presents it: a loopback origin, Tauri's__TAURI_INTERNALS__(with theinvokeandtransformCallbackthatdesktopShell()reads), and the shell's owndesktop/src-tauri/src/outside-links.jsinjected on load. The window's guard is stood in for by the consent route, which records the address as opened in the browser and answers 204 so the window stays. Gmail is the personal edition's row: Composio's directory, each person's own account.On main, the Browse apps and Connect card cases fail (Chromium), and the failed-re-read case fails in both engines: no dialog, and the browser opens straight away. On this branch the whole file passes in Chromium and WebKit (24 tests), and the full app suite passes. The file's screens block saves the step in Desktop in light and dark.