Skip to content

Move Google file transfer outside model context - #3353

Closed
reachjalil wants to merge 1 commit into
different-ai:devfrom
reachjalil:codex/cloud-file-references
Closed

reachjalil wants to merge 1 commit into
different-ai:devfrom
reachjalil:codex/cloud-file-references

Conversation

@reachjalil

Copy link
Copy Markdown
Member

Summary

Moves Gmail and Google Drive file transfer to one byte-outside-model architecture.

  • Adds scoped, expiring fileRef storage and authenticated staging/materialization routes.
  • Requires fileRef for Gmail draft attachments and Drive uploads.
  • Materializes Gmail downloads outside model context and returns only fileRef plus metadata.
  • Uses Google multipart uploads through 5 MiB and resumable uploads above 5 MiB.
  • Preserves the stored bytes, filename, and MIME type exactly. There is no Office conversion or convertTo behavior.
  • Removes model-facing inline-base64 schemas, descriptions, limits, and eval expectations.

Product behavior

Office files remain Office files. A .docx, .xlsx, or .pptx is uploaded with its original bytes, filename, and MIME type. Converting it to a native Google Doc, Sheet, or Slides file remains an explicit user action in Google Drive.

The model receives and passes opaque references only. References are scoped to the current organization member, expire after 24 hours, and cannot be reused across members.

Upload paths

  • <= 5 MiB: Google Drive multipart upload.
  • > 5 MiB: Google Drive resumable upload initialization followed by an exact-byte upload to the returned session URL.
  • Gmail draft attachments resolve their source bytes from scoped references.
  • Gmail attachment downloads are stored as references and return metadata only.

Verification

  • pnpm --filter @openwork-ee/den-db test — 10 passed, 3 environment-dependent tests skipped.
  • pnpm --filter @openwork-ee/den-api exec tsc --noEmit — passed.
  • pnpm --filter openwork-server exec tsc --noEmit — passed.
  • pnpm --filter @openwork-ee/den-api exec bun test test/google-workspace-api.test.ts test/google-workspace-capabilities.test.ts — 45 passed, 223 expectations.
  • pnpm --filter openwork-server exec bun test src/extensions/cloud-files.test.ts — 2 passed, 9 expectations.
  • pnpm evals:typecheck — passed.
  • node evals/runner/run.mjs --mode automation --flow google-workspace-gmail-draft-attachments — passed with Fraimz proof generated.
  • pnpm --filter @openwork-ee/den-api build — passed.
  • pnpm --filter @openwork-ee/den-db db:bootstrap against an isolated test database — passed.
  • git diff --check — passed.

Scope relative to #3327

This is intentionally based directly on dev, not #3327. It carries forward the useful finding that inline tool-call base64 is impractical, but does not include that PR's convertTo behavior.

@vercel

vercel Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
openwork-landing Ready Ready Preview, v0 Jul 30, 2026 1:23pm

@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

@reachjalil is attempting to deploy a commit to the Different AI Team on Vercel.

A member of the Team first needs to authorize it.

@reachjalil

Copy link
Copy Markdown
Member Author

Closing in favor of a narrower replacement. Product direction: fix the model-facing base64 upload problem with a direct, ephemeral workspace-to-Google transfer only—no file-reference persistence, database migration, conversion behavior, or legacy base64 fallback. The branch is preserved for reference.

This branch was successfully deployed

1 active deployment
Preview – openwork-landing — fd1c40bb Deployed Jul 30, 2026 by vercel[bot]
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