fix(connections): make google and google drive browser logins not tokens - #201
Merged
Conversation
The connectors tab rendered Google and Google Drive with a token field in the picker (and as token-only in the server catalog), but the product contract is browser OAuth — the card already advertises auth_methods=["browser"] and shows a "Sign in with browser" button. Align the whole path: - server: BUILT_IN_CATALOG authShape token-only -> browser for google / google-drive, and extend the authShape union to include browser so the catalog reflects the real flow. - ui: connectionFormKind returns browser for those ids (instead of token-only), ConnectionFormKind union extended, and methodEntryKind updated so the chooser resolves correctly. - picker: the Add-flow picker rendered only a token form for every built-in. It now branches on authShape: browser entries show a "Sign in with browser" button with a Browser badge, token entries keep the token form. Wired through connections-tab to startAuthPayload so the existing browser OAuth start path is used. Fixes the connectors-tab token-vs-browser mismatch; the next step (server OAuth start/callback) can land without UI churn.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe connection catalog now supports browser authentication. Google and Google Drive use browser sign-in in the connection picker, and both connections-tab flows dispatch browser authentication payloads. ChangesBrowser authentication
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant ConnectionPicker
participant ConnectionsTab
participant onStartAuth
User->>ConnectionPicker: Select browser-auth connection
ConnectionPicker->>ConnectionsTab: Invoke onStartBrowser(id)
ConnectionsTab->>onStartAuth: Dispatch browser authentication payload
ConnectionsTab->>ConnectionPicker: Close picker
Possibly related PRs
Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
This was referenced Aug 14, 2026
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.
Summary
The connectors tab rendered Google and Google Drive with a token field (picker) and
token-onlyinBUILT_IN_CATALOG, but the product contract is browser OAuth. The status card already advertisesauth_methods=["browser"]and shows a "Sign in with browser" button — the picker and catalog were the mismatch.This PR aligns the whole path to browser logins:
packages/opencode/src/server/amicode/connections.ts):BUILT_IN_CATALOGforgoogle/google-drivegoestoken-only→browser, and theConnectionEntry.authShapeunion is extended to includebrowserso the catalog endpoint reflects the real flow.packages/ui/src/amicode/connections.ts):ConnectionFormKindextended withbrowser;connectionFormKind()now returnsbrowserfor those two IDs (instead oftoken-only);methodEntryKindupdated so the auth chooser resolvesbrowser → nonecorrectly.packages/ui/src/amicode/connection-picker.tsx): the Add-flow previously rendered only a token form for every built-in. It now branches onauthShape:browserentries show a "Sign in with browser" button (with a Browser badge in the list) and no token field; token entries keep the token form. Accepts optionalonStartBrowser.packages/ui/src/amicode/connections-tab.tsx): both picker instances now passonStartBrowser→startAuthPayload(…, "browser")→props.onStartAuth, so the existing browser OAuth start path is used.What this fixes
browserend-to-end).Follow-up
Server OAuth
POST /amicode/connections/start/ callback implementation is the next step once the Google Cloud OAuth client is available. This UI change is forward-compatible.Testing
Summary by CodeRabbit