Skip to content

feat(google): One read tool for Docs, Sheets and Slides - #3364

Merged
BYK merged 1 commit into
mainfrom
feat/google-read-file
Nov 13, 2026
Merged

BYK merged 1 commit into
mainfrom
feat/google-read-file

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Follow-up to the review on #3349.

Problem

The agent had to pick one of three tools (readGoogleDoc, readGoogleSheet, readGoogleSlides) for a Google file. Each tool accepted any link or id, so a wrong choice failed only after the Drive read. Code that tells the agent how to read a file, such as the Attach note in #3349, had to map each type to its tool.

Fix

  • One readGoogleFile tool takes a link or a file id.
    • A Docs, Sheets, or Slides link names the type in its path (/document/d/, /spreadsheets/d/, /presentation/d/), and the file must have that type.
    • A bare id, or a Drive link, takes the type from the mimeType that files.get returns.
    • Other MIME types are refused.
  • Hard cutover: the three old tools are removed.
  • The Sheet range is optional, and a range on a file that is not a Sheet is refused. Docs still return revision_id.
  • The output has type and file_id (this replaces document_id, spreadsheet_id, and presentation_id), plus the fields for that type.
  • The Doc edit tools (their revision_id description and the "changed after you read it" error), the searchGoogleFiles description and the README now name readGoogleFile.
  • The link roots move into FILE_TYPES, so the link cards and the tool use one map.

Tests

tests/files.test.ts:

  • a link for each type
  • a bare id for each type: Doc, Sheet with a range, Slides
  • a Docs link to a file of another type
  • an unsupported MIME type
  • a range on a Doc

All Google tests pass (57). typecheck and lint pass, and so does the pre-push hook.

via @BYK.

--

View Session [Sentry]

readGoogleFile takes a link or a file id. A Docs, Sheets, or Slides link
names the type in its path, and the file must have that type. A bare id
or a Drive link takes the type from the Drive MIME type. It replaces
readGoogleDoc, readGoogleSheet, and readGoogleSlides.

Co-Authored-By: BYK <[email protected]>
@sentry-junior
sentry-junior Bot requested a review from BYK November 13, 2026 13:17
@vercel

vercel Bot commented Nov 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 13, 2026 1:17pm UTC

Request Review

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 13, 2026
@BYK
BYK merged commit c8fbac1 into main Nov 13, 2026
65 of 67 checks passed
@BYK
BYK deleted the feat/google-read-file branch November 13, 2026 13:37
BYK pushed a commit that referenced this pull request Nov 13, 2026
## Problem

#3364 replaced `readGoogleDoc`, `readGoogleSheet` and `readGoogleSlides`
with `readGoogleFile`. #3349 then merged with its old `readTool` map, so
on `main` the Attach note for a Google file tells the next Turn to use a
tool that no longer exists.

## Fix

- A link type's `readTool` is now a plain tool name (`readTool?:
string`), not a function of the URL. One tool reads every Google file
type and takes the type from the link, so the map has no job left.
- Google file links name `readGoogleFile`. Calendar still names no tool.

## Tests

- `junior-google/tests/links.test.ts`: Docs, Sheets and Slides links
name `readGoogleFile`, and Calendar names none.
- `tests/integration/api/object-attach.test.ts` uses the new `readTool`
shape.
- Passing: typecheck, lint, the Google tests (62), the attach, objects
and egress integration tests (10), the object-links e2e (8), and the
pre-push hook.

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3Ab4ab1661aa9222ed540303a34bce2d99 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3Ab4ab1661aa9222ed540303a34bce2d99)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Ab4ab1661aa9222ed540303a34bce2d99/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 480a4972 Deployed Nov 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant