Skip to content

Add Google Photos preset with binary-safe uploads#1137

Open
zrm625 wants to merge 8 commits into
RhysSullivan:mainfrom
zrm625:google-photos-binary-uploads-minimal
Open

Add Google Photos preset with binary-safe uploads#1137
zrm625 wants to merge 8 commits into
RhysSullivan:mainfrom
zrm625:google-photos-binary-uploads-minimal

Conversation

@zrm625

@zrm625 zrm625 commented Jun 26, 2026

Copy link
Copy Markdown

Summary

Google Photos uploads need a raw byte upload step before mediaItems.batchCreate, but Google Discovery does not publish that /uploads endpoint as an operation. Executor also receives tool arguments as JSON, so binary media cannot be safely sent through a plain body string.

This adds a focused Google Photos preset and a binary-safe bodyBase64 path for raw upload requests.

Changes

  • Add a Google Photos preset for Photos Library + Photos Picker.
  • Synthesize photoslibrary.mediaItems.upload for the raw /uploads token step missing from Google Discovery.
  • Add bodyBase64 support for application/octet-stream OpenAPI request bodies.
  • Keep the Photos preset scoped to upload, app-created media reads, and picker-selected media reads.

Related: #1096 handled binary Google media downloads. This PR handles binary upload requests.

Evidence

  • bun run test src/sdk/non-json-body.test.ts in packages/plugins/openapi
  • bun run test src/sdk/plugin.test.ts in packages/plugins/google
  • E2E_CLOUD_URL=http://localhost:43300 bun run test:cloud -- scenarios/google-photos-preset-ui.test.ts in e2e
  • bun run --cwd packages/plugins/openapi typecheck
  • bun run --cwd packages/plugins/google typecheck
  • bun run format:check
  • bun run lint
  • git diff --check

Google Photos: the focused preset opens a Photos-scoped add flow

Dogfood

Running at https://executor.home.zakstak.com/. Verified on June 25, 2026: hosted catalog exposes google_photos, photoslibrary.mediaItems.upload exposes bodyBase64, and a tiny PNG upload-token smoke returned ok: true without calling mediaItems.batchCreate.

Hermes dogfooded this as an MCP call and uploaded more than 4,000 photos and videos through this flow.

@greptile-apps

greptile-apps Bot commented Jun 26, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds a focused Google Photos integration path with binary-safe uploads. The main changes are:

  • A Google Photos preset for Photos Library and Photos Picker.
  • A synthesized photoslibrary.mediaItems.upload operation for raw upload tokens.
  • bodyBase64 support for octet-stream request bodies.
  • Scoped Photos bundle conversion for mixed and partial Google API bundles.
  • Tests for Photos preset discovery, scoped bundle tools, and binary upload validation.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.
  • The latest fixes cover the binary upload validation paths.
  • The Photos bundle scoping behavior is covered for mixed and partial bundles.

Important Files Changed

Filename Overview
packages/plugins/openapi/src/sdk/invoke.ts Adds validation and dispatch logic for bodyBase64, including invalid base64 rejection, content-type checks, required body checks, and byte-only octet-stream handling.
packages/plugins/openapi/src/sdk/extract.ts Updates generated tool input schemas so octet-stream bodies expose bodyBase64 and required mixed-content bodies accept either JSON-style body input or base64 bytes.
packages/plugins/google/src/sdk/plugin.ts Derives Photos consent scopes from the Photos preset URLs present in a bundle, including mixed and partial Photos bundles.
packages/plugins/google/src/sdk/discovery.ts Adds the synthesized Google Photos upload operation and filters Photos methods and scopes during focused bundle conversion.
packages/plugins/google/src/sdk/presets.ts Defines the Google Photos preset, preset IDs, icon, Discovery URLs, and focused OAuth scope mappings.

Reviews (8): Last reviewed commit: "fix: base64 cosplay is not media bytes" | Re-trigger Greptile

Comment thread packages/plugins/openapi/src/sdk/extract.ts Outdated
Comment thread packages/plugins/openapi/src/sdk/invoke.ts Outdated
Comment thread packages/plugins/openapi/src/sdk/invoke.ts Outdated
Comment thread packages/plugins/google/src/sdk/plugin.ts Outdated
Comment thread packages/plugins/google/src/sdk/plugin.ts Outdated
Comment thread packages/plugins/openapi/src/sdk/invoke.ts Outdated
@zrm625

zrm625 commented Jun 26, 2026

Copy link
Copy Markdown
Author

Nested Base64 Still Falls Through

This last bit was the part I was least sure of what you wanted. I will work on this function again tomorrow.

Comment thread packages/plugins/openapi/src/sdk/invoke.ts
Comment thread packages/plugins/openapi/src/sdk/invoke.ts Outdated
Comment thread packages/plugins/openapi/src/sdk/invoke.ts Outdated
@zrm625 zrm625 force-pushed the google-photos-binary-uploads-minimal branch from 9eada52 to 2bdddeb Compare June 27, 2026 00:38
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.

1 participant