Repository navigation
feat(google_docs): new Google Docs tool plugin (1.0.0); fix: short sign-in link for Each user signs in (1.0.1) - #4186
Closed
ForeignKeyCN wants to merge 2 commits into
Closed
ForeignKeyCN wants to merge 2 commits into
ForeignKeyCN wants to merge 2 commits into
Conversation
…er signs in (1.0.0)
Applies to outlook, teams, onedrive, microsoft_excel_365, microsoft_todo, sharepoint, jira, confluence, trello and google_calendar. In "Each user signs in" mode the agent retypes the sign-in link in its reply, and a long random state does not always survive that: in a real chat one character changed case, so the callback endpoint could not recognize the sign-in. The tool now returns <sign-in endpoint>?start=<12 lowercase characters without look-alikes>, and the endpoint redirects to the sign-in page it stored. The state and PKCE values go to the provider and back without passing through the agent.
This was referenced Nov 2, 2026
Closed
Contributor
Author
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.
This PR has two parts:
tools/google_docs, 1.0.0).It replaces #4183 and #4184.
Part 1: Google Docs tool plugin (1.0.0)
Summary
A new Google Docs tool plugin (
tools/google_docs). It reads, creates and edits documents from workflows and agents. Content goes in and comes out as Markdown, so an agent can write a formatted document and read it back. It is built like the other Google plugins: Calendar (#4173), Gmail (#4180), Drive (#4181) and Sheets (#4182).Auth
GET /google_docs/callback) that only stores the one-time code.?start=<id>), which redirects to Google. Agents retype links, and a long randomstatedoes not always survive that.client_id | Dify user ID, and never appear in tool output.invalid_grantor a 401 leads to a new sign-in.google_docs_sign_outforgets the sign-in.documents: read and write documents.drive.metadata.readonly: only to find documents by name.Tools (prefixed
google_docs_: the new Agent rejects duplicate tool names across plugins)google_docs_find_documentsgoogle_docs_get_documentgoogle_docs_create_documentgoogle_docs_append_contentgoogle_docs_replace_textgoogle_docs_insert_tableMarkdown written:
#/##/###headings;-/*bullets and1.numbered lists;**bold**,*italic*and[text](https://link).Everything else becomes normal paragraphs.
Writing: one
batchUpdateper call. The inserted text is reset to normal style first, so it doesn't inherit the style around it.Tables: cells are filled bottom-up, so earlier indexes stay valid (limit 2000 cells).
Document IDs: tools accept an ID or a URL.
Output variables: every tool returns typed output variables (
success/errorplus its fields).Release Notes
Change Type
Screenshots / Videos
None yet; the README describes the setup and what users see.
Testing
pytest tests). They cover:google_docs_sign_outand OAuth mode (unit tests only).Part 2: give the agent a short sign-in link (1.0.1)
Problem
In Each user signs in mode, the tool returns a sign-in link and the agent passes it on to the user in its reply. The agent retypes the link rather than copying it, and a long random value does not always survive that. In a real chat, one character of the
stateparameter changed case (...X3FQbecame...X3fQ), so the callback endpoint showed "Sign-in link not recognized".Fix
<sign-in endpoint>?start=<id>.idis 12 lowercase characters without look-alikes (0/o,1/l).stateand PKCE values go to the provider and come back without passing through the agent.Nothing changes for administrators: same endpoint, same redirect URI, same credential.
Plugins (1.0.0 → 1.0.1)
outlook, teams, onedrive, microsoft_excel_365, microsoft_todo, sharepoint, jira, confluence, trello, google_calendar
The open PRs for gmail (#4180), google_drive_tool (#4181) and google_sheets (#4182) already include the same change.
Tests
Checklist