Google Drive integration (agent-driven file management)
Google Drive in Omniscio two ways: a live Drive panel in the sidebar (grid/list, preview, upload, share — DriveProjectView.tsx, reachable from the sidebar and poppable into its own panel), and seven tool-use calls an agent can make to list, search, create, move and share files, over the same single Connect Google consent the other Google integrations use.
On this page
What it is
Omniscio's Google Drive integration is mainly agent-facing: alongside the Drive panel's file browser (DriveProjectView.tsx — grid/list, preview, upload, share), Claude gets seven Drive tool-use calls inside any chat conversation, so you ask in plain English ("create a folder called 2026-campaigns and move the assets from #design-review into it", "share the quarterly report with sarah@…", "what's my Drive quota looking like") and the agent decides which tool to call, Omniscio executes it via Google's API, and the agent continues its turn using the result. Drive shares the same single "Connect Google" OAuth as Calendar, Sheets, and Gmail — one consent, all four integrations.
⚠️ Drive scope narrowed (2026-08). To keep Drive out of Google's restricted-scope review, the shared "Connect Google" OAuth requests
drive.file(only files the app itself creates) instead of fullauth/drive, which Google classifies as "restricted". This does NOT avoid the annual CASA security assessment: the Gmail scopesgmail.modifyandgmail.settings.basicare restricted too, so the assessment is owed for Gmail regardless —drive.filejust keeps Drive from widening it. Underdrive.file, the six existing-file tools below (list / get / move / share / delete / quota) and the read-only Drive MCP no longer work — only creating new files/folders does. The read-only Drive MCP is already force-disabled (DRIVE_MCP_TIER3_DISABLED,mcp-config-orchestrator.ts); the guard test oauth-scopes-casa-tier2.test.ts scans every shippedsrc/file and allows no restricted scope beyond the two Gmail ones submitted to Google. Full Drive over a user's existing files is moving to a bring-your-owngogCLI path — a user who sets up thegogGoogle Workspace CLI with their own Google credentials gets full Drive without adding a restricted Drive scope to Omniscio's own Google review. Fully retiring the built-in Drive AI service + channel adapter and wiring the gog path is a tracked FOLLOW-UP; today the built-in Drive is opt-in (driveEnabled, default off) and degrades to create-only when enabled.
Where to find it
How to use it
- Connect Google. Settings → Google → Connect Google. A browser tab opens; approve the scopes for Calendar, Drive, Sheets, and Gmail in one go. Omniscio catches the OAuth redirect on a loopback HTTP server, encrypts the refresh token via
safeStorage, and stores it. - Toggle Drive on. Settings → Google Drive → enable
driveEnabled. The OAuth scopes were already requested at connect time; this flag controls whether Omniscio actually issues Drive requests. - Open the Drive panel. Select Drive in the sidebar — the same panel the other connected services (Dropbox, OneDrive, Sheets) get. The sidebar pane is DriveFileList.tsx, rendered by SessionsSidebarRouter.tsx when Drive is the selected panel; the full panel — grid/list, preview, upload, share — is DriveProjectView.tsx, which renders that same list and is mounted by DashboardDesktopLayout.tsx. The panel can be popped out into its own window.
- Ask the agent for Drive things. In any Claude session, type natural-language requests — the agent has access to seven Drive tools: list files, get a single file's metadata, create a folder, delete a file, move a file, share a file with someone, and check Drive quota. Results come back as markdown with clickable
webViewLinks opening Drive in the browser. - The old Drive MCP server for CLI sessions is retired. It needed the restricted
drive.readonlyscope, so it is force-disabled (see the scope note above). Omniscio no longer writes anything into~/.claude.jsonfor it — it only removes the old entry at startup and on disconnect — and the Google refresh token never leaves Omniscio's encrypted config. Agents reach Docs, Sheets and Drive through the bundled Google Workspace MCP instead, which gets a short-lived access token from Omniscio at call time. The Google Drive settings panel says this in plain words whileDRIVE_MCP_TIER3_DISABLEDholds: "Drive tools for Claude sessions are turned off in this version. Reconnecting Google does not turn them on." It never asks the user to re-authenticate for these tools, because reconnecting cannot bring them back.
How it behaves
How it works
Google OAuth lives in google-auth-service.ts — single flow, loopback HTTP redirect, encrypted refresh token. The Drive AI service is drive-ai-service.ts: seven tools (list_files, get_file, create_folder, delete_file, move_file, share_file, get_storage_quota) wrapping the googleapis npm package, executed inside a token loop that runs agent message → Claude returns tool_use → Omniscio executes via googleapis → result appended → repeat until stop_reason='end_turn'. A circuit breaker prevents thundering-herd API storms; per-account cost tracking attributes API spend; errors return as tool results so Claude can recover the same turn. IPC handler: drive-handlers.ts (channel DRIVE_AI_CHAT plus non-AI list/CRUD endpoints). mcp-registry.ts now only unregisters the retired read-only Drive MCP's legacy ~/.claude.json entry (unregisterDriveMcp); no refresh token is written into any MCP config. The unified-inbox adapter (used when Drive items are surfaced in the sidebar) is drive-adapter.ts. Settings flag: driveEnabled in types.ts.
The settings panel is DriveSettings.tsx. The one Google sign-in belongs to the Google Account card above it, so the panel offers no "connect" button of its own. It still runs its own drive:status check, because that check carries Drive-specific errors the account check does not, and it re-runs that check whenever the shared sign-in changes (googleChangeToken). drive:status takes no payload, unlike the OneDrive and Dropbox status channels, which take an object.
The panel asks the user to reconnect Google only when drive:status sets needsReauth: "Drive needs updated permissions — reconnect Google above". That flag is set when Google answers with an insufficient-scope or insufficient-permission error (for example, the user unticked Drive on Google's consent screen) or the sign-in is revoked or expired, and reconnecting with Drive allowed fixes both. Every other failure arrives as a plain sentence the main process already wrote (humanizeProviderStatusError), never Google's raw text, so the panel never promises that signing in again will fix it.
The command-line Drive reads
GET /drive/statusanswers{ available, authenticated, account, error?, needsReauth?, via? }, the same connect state the settings panel shows first, so a caller can tell which drives are linked without inferring it from a failing list. TheAMC_GOOGLE_FAKEtest stub lives in the panel's handler, not in the service, so this route never sees it.GET /drive/filestakes?folderId=(a folder to list, otherwise every file),?query=(name contains),?mimeType=,?pageToken=and?pageSize=. An out-of-range page size (0, negative, not a number, over 100) is quietly clamped to the maximum or the default of 50 instead of refused.- No in-app sign-in, but signed in to the
gogcommand-line tool: both routes read through gog instead, read-only, on the one gog account that has Drive, and the status saysvia: "gog"(via: "app"when the in-app sign-in answered). The in-app sign-in always wins when it is present, and switching the Drive integration off stops both roads. A gog list is newest first without folders grouped at the top, because gog sorts by one key only. File contents, downloads, the storage quota and every change still need the in-app sign-in. Code: drive-gog-read.ts; rules: google-cli-fallback-contract.md (I7).
Related
- INDEX.md — full library index
- google-integrations.md — umbrella doc for Calendar + Drive + Sheets, shared OAuth
- sheets-integration.md — sibling Google integration with similar agent-driven UX
- gmail-integration.md — Gmail uses the same Google OAuth flow
Last verified 2026-11-03