Reach files in shared drives from the Google Drive connector - #589
Merged
Merged
Conversation
Drive leaves shared drive items out of any files.get or files.list that does not say it supports shared drives, and none of the connector's requests said so. A document the person could open in a shared drive was File not found by id and never appeared in a search or the recent list. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
kevin9327
requested review from
MikeRyanDev,
davidmckayv,
guidovizoso,
mxmzb and
tylerslaton
as code owners
September 16, 2026 21:57
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
# Conflicts: # CHANGELOG.md
davidmckayv
approved these changes
Sep 16, 2026
davidmckayv
left a comment
Contributor
There was a problem hiding this comment.
Code-verified clean; CI green on this sha.
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.
What this changes
Google's shared drives guide lists
files.getandfiles.listamong the methods that needsupportsAllDrives=truebefore they will handle shared drive items. For listings it adds, onincludeItemsFromAllDrives:None of the Drive connector's requests send either parameter:
get_file_metadatafiles.getGoogle Drive refused this request (404): File not found: …read_file_contentfiles.getfor the type, thenalt=mediaor exportsearch_files,list_recent_filesfiles.listSo a Bot with the connector granted could not read a document the person asking can open, whenever it sits in a shared drive, which is where many Workspace organisations keep their documents. The connector's docs say it reads Drive as the person asking, and the failure reads as a missing file rather than a missing parameter.
After this change:
files.listsendssupportsAllDrives=true&includeItemsFromAllDrives=true.corporais left at Drive's defaultuser, which the guide recommends overallDrives. Listings gain the shared drive files that corpus covers and nothing broader.files.get(the metadata lookup,read_file_content's type lookup and itsalt=mediadownload) sendssupportsAllDrives=true.files.exportis unchanged. Its only parameter ismimeType.Nothing else changes: the fields asked for, how results are formatted, what is refused, and the scope (
drive.readonly). A My Drive file is answered exactly as before. For files outside shared drives the parameter says only that the client can handle both kinds.This touches the same file as #588 (the trash filter), in separate hunks. I merged the two branches locally: the source and the test file auto-merge, and all 21 cases pass. Only
CHANGELOG.mdconflicts.Where it runs
Boundary and audit
callToolare untouched.Changelog
CHANGELOG.mdunderUnreleased.Proof
A new
describeblock inserver/tests/google-drive-rest.test.tsuses the file's existingstubFetchand asserts the parameters on every request each tool makes: both listings, the metadata lookup, and both requests of a text-file read.With
google-drive-rest.tsfrommain(only the tests added):With the fix:
bun test --coverage server/tests/google-drive-rest.test.ts: 21 pass, 0 fail. The existing 18 are unchanged, including the exactqandorderByassertions. The only uncovered lines ingoogle-drive-rest.tsare 175–181, the network-error branch ofrequest, which this change does not touch.bun run typecheck(app, server, worker): exit 0.bunx biome checkandbiome lint --error-on-warningson the changed files: clean.I have no Google Workspace account wired to a deployment here, so this was not driven against live Drive. The behaviour it fixes is the one Google's guide documents above, and the tests pin the parameters this connector now sends.
This PR adds its entry at the top of
## Unreleased, where other open PRs add theirs, so the changelog may conflict. I can rebase if it does.🤖 Generated with Claude Code