Skip to content

Show the Composio step in OpenBot Desktop's window before the browser opens - #1758

Merged
davidmckayv merged 4 commits into
mainfrom
fix/consent-step-in-desktop
Nov 17, 2026
Merged

davidmckayv merged 4 commits into
mainfrom
fix/consent-step-in-desktop

Conversation

@davidmckayv

@davidmckayv davidmckayv commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

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:

const consent = desktopShell()
  ? null
  : await brokeredConsentFor(queryClient, serverId);

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.

brokeredConsentFor answers correctly when the read succeeds: for the personal edition's Gmail the app setup says composio and the app's source is directory.

What changed

  • useConnectInNewTab now 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.
  • The hook returns the dialog as 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.
  • brokeredConsentFor decides 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).
  • In a browser nothing changes: the new tab shows the step as its own page, then goes on.
  • The consent address never goes in a page's address. In Desktop the step never uses /connecting at all.

Tests

app/tests/consent-handoff.test.tsx gains 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 the invoke and transformCallback that desktopShell() reads), and the shell's own desktop/src-tauri/src/outside-links.js injected 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.

  • Gmail's page: Connect shows the step counting down from 5, nothing reaches the browser for 2 seconds, and the sign-in opens at 0 while the window stays put.
  • Gmail's page: Cancel opens nothing; Continue now opens the sign-in at once.
  • Gmail's page: the step still shows when the apps list fails to load again at the press.
  • Browse apps: Add shows the step in the window before the browser opens.
  • Browse apps: Connect on an added Gmail that isn't connected shows the step.
  • A Bot's Connect card: the step shows; Cancel opens nothing; at 0 the sign-in opens.

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.

… 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
davidmckayv force-pushed the fix/consent-step-in-desktop branch from 9b6d8c6 to 9f6fde7 Compare November 17, 2026 15:10
@davidmckayv
davidmckayv merged commit 097f8c6 into main Nov 17, 2026
62 checks passed
@davidmckayv
davidmckayv deleted the fix/consent-step-in-desktop branch November 17, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant