Skip to content

feat(drive): add drive.replyToComment and drive.resolveComment tools#397

Open
matheusrmorgado wants to merge 2 commits into
gemini-cli-extensions:mainfrom
matheusrmorgado:feat/drive-comment-replies
Open

feat(drive): add drive.replyToComment and drive.resolveComment tools#397
matheusrmorgado wants to merge 2 commits into
gemini-cli-extensions:mainfrom
matheusrmorgado:feat/drive-comment-replies

Conversation

@matheusrmorgado

Copy link
Copy Markdown

Summary

Fixes #343 by adding the two write-side Drive comment tools, complementing the existing read-only drive.getComments:

  • drive.replyToComment(fileId, commentId, content) — posts a reply to an existing comment via replies.create
  • drive.resolveComment(fileId, commentId, content?) — marks a comment resolved via replies.create with action: "resolve", optionally posting a closing message

This closes the common agent loop of "read the comments on this doc, address them, reply and resolve" — today the read half exists but the write half requires leaving the extension.

Design notes

  • Both tools live in the drive.write feature group and reuse its existing drive OAuth scope — the consent surface is unchanged.
  • File IDs accept full URLs (same extractDocumentId normalization as the other Drive tools).
  • fields masks limit responses to id/content/author/createdTime (+ action for resolve), matching the getComments field style.

What's included

  • Service methods in DriveService following the existing logging/handleError conventions
  • Tool registration with Zod schemas (content is min(1) on reply; optional on resolve)
  • 6 Jest tests: request shapes for both tools, URL extraction, optional closing message, error paths
  • docs/index.md entries

Verification

npm run test && npm run lint && npm run format:check && npx tsc --noEmit --project workspace-server

All passing: 29 suites, 625 tests (619 existing + 6 new), eslint/prettier/tsc clean.

Made with Cursor

@google-cla

google-cla Bot commented Jun 12, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds two new tools, drive.replyToComment and drive.resolveComment, along with their respective tests and documentation. The feedback recommends adding the supportsAllDrives: true parameter to the Google Drive API calls to ensure support for Shared Drives, and omitting the content field from the request body in resolveComment when it is not provided. Corresponding test updates are also suggested.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread workspace-server/src/services/DriveService.ts
Comment thread workspace-server/src/services/DriveService.ts
Comment thread workspace-server/src/__tests__/services/DriveService.test.ts
Comment thread workspace-server/src/__tests__/services/DriveService.test.ts
Implements the two write-side Drive comment tools proposed in gemini-cli-extensions#343,
complementing the existing read-only drive.getComments:

- drive.replyToComment(fileId, commentId, content): posts a reply via
  replies.create
- drive.resolveComment(fileId, commentId, content?): marks the comment
  resolved via replies.create with action: 'resolve', optionally with a
  closing message

Both live in the drive.write feature group and reuse its existing 'drive'
OAuth scope, so the consent surface is unchanged. Includes Jest coverage
(request shapes, URL-to-ID extraction, error paths) and docs/index.md
entries.
…es does not apply

Addresses gemini-code-assist review: resolveComment now omits the content
field entirely when no closing message is provided instead of sending an
empty string. The supportsAllDrives suggestion does not apply here:
replies.create takes no such parameter (it belongs to the files/drives
endpoints, confirmed by the Drive v3 reference and the googleapis typings,
which reject it at compile time); a code comment records that.
@matheusrmorgado matheusrmorgado force-pushed the feat/drive-comment-replies branch from 60198f5 to 98ac5d8 Compare June 12, 2026 21:23
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.

Add drive.replyToComment and drive.resolveComment tools

1 participant