Skip to content

fix(google-docs): accept successful document creation responses - #52335

Closed
Afloat16 wants to merge 1 commit into
stablyai:mainfrom
Afloat16:fix/google-docs-create-response
Closed

Afloat16 wants to merge 1 commit into
stablyai:mainfrom
Afloat16:fix/google-docs-create-response

Conversation

@Afloat16

Copy link
Copy Markdown
Contributor

ELI5

Creating a Google Doc can succeed in Drive while Orca reports a failure. Request the response field Orca needs to recognize the created document and return its ID and link.

What Changed

  • Include mimeType in the existing multipart create request's response fields.
  • Add one regression test through the public createDoc operation. Its Google API fixture returns only fields selected by the actual request and runs the real production response reader.

Why

createDoc previously requested id,name,webViewLink, but DriveFileSchema requires mimeType. A successful filtered response was therefore rejected after the document had already been created. A caller retry could create a duplicate document.

Requesting the missing field preserves the shared schema's validation without adding another network request or weakening response parsing.

Linked Issue

Fixes #52333

Visual Proof

N/A — this changes a backend response contract; it adds no UI, layout, or interaction controls.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below
  • Every added test fails without this change and avoids the test anti-patterns

Local Linux / Node 24 source-level reproduction exercised the real createDoc operation and production parser: the original field mask rejected the successful response; the corrected mask returned the created document.

Exact source commit: b286b5f31289c5364fb5bf2b18ff51a7e09a2ada.

Fork validation run:

  • Replaced only the production file with the unchanged base version: the single regression fails with Unreadable creation response, as expected.
  • Restored the exact fix and ran pnpm test src/main/google/google-docs-create.test.ts --maxWorkers=2: 1 test passed.
  • Ran pnpm check:changed --base=f6e561e9ec050afbaa5bfb55bfac4b31dc394f6c --maxWorkers=2: all 28 selected checks passed.
  • Verified the tracked source remained unchanged after validation.

The fixture models Google's documented partial-response contract. No live Google account writes or native macOS/Windows/SSH sessions were used. Broader platform coverage remains with the upstream CI.

Performance

The existing create request returns one additional scalar mimeType value. There are no additional API calls, subprocesses, disk operations, background work, polling, or renderer updates. The extra response bytes occur only when creating a document.

Risk

Level: Low.

The change is limited to response-field selection for Google Docs creation. The main risk is requesting a field incompatible with Drive's File response; mimeType is already required by the shared File schema and requested by the other Drive file operations. No credentials, scopes, stored data, or transport contracts change. A plain revert restores the previous field selection; it does not remove documents already created.

AI Disclosure

Contributor and commit author: Afloat16. Model used: GPT-6 Astra Pro for implementation and code review.

Review

Independent review traced the CLI/RPC call through createDoc and the actual response parser, checked the Google partial-response contract, and reviewed the regression against the original implementation. No blocking issue was found.

The request uses the existing Google API/authentication path and introduces no platform-specific paths, binaries, SSH or mobile protocol changes. Agent callers receive the existing successful result shape. Security, UI behavior, backwards compatibility, and performance boundaries were checked; the strict response schema remains intact.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Checked existing open and closed contributions for this response-field mismatch; no duplicate fix was found. Related folder-resolution and Google scope changes address different paths.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@greptile-apps

greptile-apps Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The PR appears safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge.

Summary

Fixes Google Docs creation reporting failure after Google has created the document.

  • Google Docs creation requests the file type needed to read Drive’s reply.

No actionable issues found. Review was based on source inspection; tests were not run during this review.

Reviews (2) · Last reviewed commit: "fix(google-docs): accept successful docu..." · Reviewed by Greptile

@coderabbitai

coderabbitai Bot commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

createDoc now requests mimeType alongside id, name, and webViewLink in the Drive upload response. A regression test checks that a response filtered by the requested fields resolves with the writer’s account, document ID, title, link, and Created status.

Severity of issue fixed: Medium

Merge Risk: Minimal · up to b286b

Creating a Google Doc now returns the document's ID and link instead of reporting an error after the document was already created. The change is small and its risk is low, so it looks ready to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(google-docs): accept successful document creation responses" matches the main change. The PR adds mimeType to the Drive create response fields so a successful creation is no longer reje…
Description check Passed The description follows the repository template. It includes ELI5, What Changed, Why, a linked issue (Fixes #52333), Visual Proof marked N/A with a reason, Testing with checklist items and detailed ve…
Linked Issues check Passed Issue #52333 requires that createDoc return a successful result when Google creates a document, even when the create response is filtered to the requested fields. At the reviewed head, `src/main/goo…
Out of Scope Changes check Passed The PR changes two areas. The first is the createDoc create-request field mask in src/main/google/google-docs.ts, which adds mimeType to the existing fields value. This is the fix named by #52…
Full details: Title check

Explanation

The title "fix(google-docs): accept successful document creation responses" matches the main change. The PR adds mimeType to the Drive create response fields so a successful creation is no longer rejected by the parser. The title is specific and follows a conventional-commit style. It describes the fix from the developer's perspective and does not list files.

Full details: Description check

Explanation

The description follows the repository template. It includes ELI5, What Changed, Why, a linked issue (Fixes #52333), Visual Proof marked N/A with a reason, Testing with checklist items and detailed verification steps, Performance with a 'None, because' style line, Risk with a level and revert plan, the AI Disclosure section, Review, the upstream boundary checkbox, Notes, and the checklist. It is mostly complete. The Performance and Risk sections are substantive. Minor issues: the Testing section relies on a fork CI run and a specific source commit, and the Risk section does not mention remote or SSH impact in detail. These are non-critical.

Full details: Linked Issues check

Explanation

Issue #52333 requires that createDoc return a successful result when Google creates a document, even when the create response is filtered to the requested fields. At the reviewed head, src/main/google/google-docs.ts sets the multipart create field mask to id,name,mimeType,webViewLink. DriveFileSchema is still the parser passed to api.send, so the shared schema validation is kept. The mask now includes mimeType, which the issue identifies as the missing field. The added test src/main/google/google-docs-create.test.ts calls the public createDoc entry. Its send fixture returns only the fields named in the request's fields parameter and passes them to the production reader. It asserts a resolved result with account, id, title, link, and done: 'Created', which matches the issue's expected behavior. The base-side failure (Unreadable creation response) comes from the PR's fork validation run and the issue text. The diff tool could not read the changed blobs, so I did not re-run the base comparison. The head source and test content support the fix. No unresolved coding requirement remains.

Full details: Out of Scope Changes check

Explanation

The PR changes two areas. The first is the createDoc create-request field mask in src/main/google/google-docs.ts, which adds mimeType to the existing fields value. This is the fix named by #52333. The second is the regression test src/main/google/google-docs-create.test.ts, which supports the fix. The PR description states no other behavior changes, and the test covers only the createDoc create path. The PR description also states that no additional API calls, dependencies, UI, credential, or scope changes are introduced. I did not find an unrelated change in the inspected content. The diff tool could not produce the full changed-file list, so this result covers the two files named in the PR summary and the inspected head content.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2047eb0c-3d5c-404c-afae-ff4871237c74
Commits

Reviewing files that changed from the base of the PR and between f1a005a and b286b5f.

Files selected for processing: 2

  • src/main/google/google-docs-create.test.ts
  • src/main/google/google-docs.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@nwparker

Copy link
Copy Markdown
Contributor

Thanks @Afloat16 for tracking this down and for the regression test! We're landing your fix in #52346, rebased onto the latest main with no code changes. The commit keeps you as the author, so your authorship is preserved. Closing this one in favor of that PR.

@nwparker nwparker closed this Nov 29, 2026
nwparker added a commit that referenced this pull request Nov 29, 2026
…sponse parses (#52346)

createDoc asked Drive for id,name,webViewLink but parsed the answer with
DriveFileSchema, which requires mimeType. The partial response failed to
parse, so the CLI reported a failure after the doc was already created,
and a retry made a duplicate. Request mimeType too.

Fixes #52333

Original fix by Afloat16 (#52335).

Co-authored-by: Afloat <[email protected]>
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.

[Bug]: Successful Google Docs creation is reported as an unreadable response

2 participants