Skip to content

An open-source, faster Devin alternative

TypeScript

docs+web: answer the three review points — the secrets note was one overloaded sentence, so it splits into connected accounts and GitHub's two separate paths; drive and sheets are absent from the connections picker because the platform has no auth config for them and linking one fails, which the services table now says rather than implying they work; and connectionServiceId returned undefined for both, which stranded such a connection in the dashboard with no way to reconcile or disconnect it

Brian Reardon3b5ba3f538a1
diff --git a/docs/agents/secrets.mdx b/docs/agents/secrets.mdx
index c1eeb7d4..060dad59 100644
--- a/docs/agents/secrets.mdx
+++ b/docs/agents/secrets.mdx
@@ -8,9 +8,13 @@ connections. Plaintext values are not included in source bundles, prompts,
deployment manifests, runtime environment variables, logs, or API responses.
<Note>
-A credential the platform holds for someone — Gmail, Calendar, Drive, Sheets,
-GitHub — is not a secret you set here. See
-[Connected services](/agents/services).
+Some credentials are not secrets you set. When someone connects their Gmail,
+Calendar, Drive or Sheets account, the platform holds and refreshes that
+credential — see [Connected services](/agents/services).
+
+GitHub has two paths: the same connected-account route for its REST API, and a
+[GitHub App connection](/agents/github) when the agent needs to run `git` and
+`gh` itself.
</Note>
## Declare a connection
diff --git a/docs/agents/services.mdx b/docs/agents/services.mdx
index f4250634..c246c03f 100644
--- a/docs/agents/services.mdx
+++ b/docs/agents/services.mdx
@@ -123,12 +123,16 @@ without it, `listServices()` returns nothing.
| --- | --- | --- |
| `gmail` | `gmail.googleapis.com` | Google |
| `calendar` | `www.googleapis.com` | Google |
-| `drive` | `www.googleapis.com` | Google |
-| `sheets` | `www.googleapis.com` | Google |
+| `drive` | `www.googleapis.com` | Google * |
+| `sheets` | `www.googleapis.com` | Google * |
| `github` | GitHub's API | GitHub |
-The four Google services are one consent; GitHub is its own. A name outside
-that list fails the build rather than the request.
+The Google services share one grant; GitHub is its own. A name outside that
+list fails the build rather than the request.
+
+\* Drive and Sheets are recognised by the SDK but are not enabled on the
+platform yet — connecting one fails until an auth config exists for it. Gmail,
+Calendar and GitHub work today.
<Note>
There are two ways to reach GitHub, and they are for different jobs. Use
diff --git a/web/src/managed-agents/Connections.tsx b/web/src/managed-agents/Connections.tsx
index 3aaa3db6..23e38950 100644
--- a/web/src/managed-agents/Connections.tsx
+++ b/web/src/managed-agents/Connections.tsx
@@ -47,44 +47,37 @@ function displayResourceName(value: string) {
.replace(/\b\w/g, (character) => character.toUpperCase())
}
+// A Google grant's scopes say which service it is; the provider does not.
+// Sheets is checked before Drive because a Sheets grant carries drive scopes
+// too, and Drive first would claim it.
+const GOOGLE_SERVICES = [
+ { id: 'calendar', name: 'Google Calendar', scope: '/auth/calendar' },
+ { id: 'sheets', name: 'Google Sheets', scope: '/auth/spreadsheets' },
+ { id: 'drive', name: 'Google Drive', scope: '/auth/drive' },
+ { id: 'gmail', name: 'Gmail', scope: '/auth/gmail.' },
+] as const
+
+function googleServiceFor(scopes: string[]) {
+ return GOOGLE_SERVICES.find((service) =>
+ scopes.some((scope) => scope.toLowerCase().includes(service.scope)),
+ )
+}
+
function connectionService(connection: { provider: string; scopes: string[] }) {
- if (
- connection.scopes.some((scope) =>
- scope.toLowerCase().includes('/auth/calendar'),
- )
- ) {
- return 'Google Calendar'
- }
- if (
- connection.scopes.some((scope) =>
- scope.toLowerCase().includes('/auth/gmail.'),
- )
- ) {
- return 'Gmail'
- }
- return displayResourceName(connection.provider)
+ return (
+ googleServiceFor(connection.scopes)?.name ??
+ displayResourceName(connection.provider)
+ )
}
function connectionServiceId(
connection: ManagedAgentConnection,
-): 'gmail' | 'calendar' | 'github' | undefined {
+): 'gmail' | 'calendar' | 'drive' | 'sheets' | 'github' | undefined {
if (connection.provider === 'github') return 'github'
if (connection.provider !== 'google') return undefined
- if (
- connection.scopes.some((scope) =>
- scope.toLowerCase().includes('/auth/calendar'),
- )
- ) {
- return 'calendar'
- }
- if (
- connection.scopes.some((scope) =>
- scope.toLowerCase().includes('/auth/gmail.'),
- )
- ) {
- return 'gmail'
- }
- return undefined
+ // Returning undefined here strands the connection: the page skips it when
+ // reconciling and cannot disconnect it either.
+ return googleServiceFor(connection.scopes)?.id
}
async function loadManagedAgentConnections() {
@@ -572,6 +565,9 @@ export default function ManagedAgentConnections() {
>
<option value="gmail">Gmail</option>
<option value="calendar">Google Calendar</option>
+ {/* Drive and Sheets are recognised everywhere else here, but
+ are not offered until the platform has an auth config for
+ them — without one the link call fails. */}
</select>
</div>
<div className="grid gap-2">