Skip to content

fix: support Google Shared Drives in gdrive connector#72

Open
joelchrist wants to merge 1 commit into
open-webui:mainfrom
joelchrist:fix/gdrive-shared-drives
Open

fix: support Google Shared Drives in gdrive connector#72
joelchrist wants to merge 1 commit into
open-webui:mainfrom
joelchrist:fix/gdrive-shared-drives

Conversation

@joelchrist

Copy link
Copy Markdown

Summary

Fixes #52 — the gdrive connector reported "nothing to do" when the target folder lives inside a Google Shared Drive (formerly Team Drive), even with correct service-account permissions.

The Drive API's files.list does not return items from Shared Drives unless the request opts in with supportsAllDrives=True and includeItemsFromAllDrives=True. Personal "My Drive" folders work because they don't require these flags — which is why the connector worked in that case but silently returned an empty listing for Shared Drives.

Changes

src/oikb/connectors/gdrive.py:

  • Add supportsAllDrives=True and includeItemsFromAllDrives=True to all files.list calls — one in _walk_folder() and both in _find_file().
  • Pass supportsAllDrives=True to files.get and files.get_media in read_file() so Shared Drive files can be downloaded. (files.export accepts only fileId/mimeType and works by ID, so it is left unchanged.)

The flags are a no-op for My Drive folders, so existing behaviour is unchanged.

Testing

  • python -m py_compile src/oikb/connectors/gdrive.py passes.
  • Manual: with a service account granted access to a Shared Drive folder, oikb diff gdrive:<shared-drive-folder-id> --kb-id <kb> now lists files instead of reporting "nothing to do".

🤖 Generated with Claude Code

The Drive API does not return items from Shared Drives (formerly Team
Drives) unless requests opt in with supportsAllDrives and
includeItemsFromAllDrives. Without them, syncing a folder inside a
Shared Drive listed no files and reported "nothing to do", even with
correct service-account permissions.

Add these flags to all files.list calls in _walk_folder and _find_file,
and pass supportsAllDrives to the file get/get_media download calls so
Shared Drive files can be fetched.

Fixes open-webui#52

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

gdrive connector does not support Shared Drives

1 participant