Skip to content

fix(den-api): preserve Gmail draft formatting - #3449

Merged
benjaminshafii merged 1 commit into
devfrom
fix/gmail-draft-formatting
Aug 3, 2026
Merged

benjaminshafii merged 1 commit into
devfrom
fix/gmail-draft-formatting

Conversation

@benjaminshafii

Copy link
Copy Markdown
Member

Summary

  • emit Gmail drafts as multipart/alternative with equivalent plain-text and escaped HTML bodies
  • nest alternatives under multipart/mixed when drafts include attachments
  • fold base64 MIME payloads to 76 characters and teach the Google test witness to decode nested MIME

Verification

  • pnpm --filter @openwork-ee/den-api exec bun test test/gmail-draft.test.ts — 17 passed
  • pnpm --filter @openwork-ee/den-api exec bun test test/google-workspace-capabilities.test.ts — 34 passed
  • pnpm --dir evals exec node --test packages/labs/test/mock-google.test.ts — 3 passed
  • pnpm --filter @openwork-ee/den-api build — passed
  • pnpm evals:spec — 6 passed, 1 skipped (skill-grant-access, requires configured Infisical service token)
  • pnpm evals:typecheck — pre-existing failure on origin/dev: evals/flows/den-trim-page-headers.flow.ts references missing FlowContext.page

Evidence

This server MIME change has deterministic raw-message, route, and nested Google witness coverage. A live Gmail desktop send was not run because that requires a real external mailbox; the MIME assertions cover the exact serialization boundary changed here.

@vercel

vercel Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
openwork-app Ready Ready Preview Aug 3, 2026 10:22am
openwork-den Ready Ready Preview Aug 3, 2026 10:22am
openwork-den-worker-proxy Ready Ready Preview Aug 3, 2026 10:22am
openwork-diagnostics Ready Ready Preview Aug 3, 2026 10:22am
openwork-landing Ready Ready Preview, v0 Aug 3, 2026 10:22am

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warden security clearance: clear. No new security issues found in this diff (ffe3cdcd1c761f562cfb692a9807da390dd1ecaa). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@benjaminshafii
benjaminshafii merged commit 63b6830 into dev Aug 3, 2026
20 checks passed
@benjaminshafii
benjaminshafii deleted the fix/gmail-draft-formatting branch August 3, 2026 10:28
benjaminshafii pushed a commit that referenced this pull request Aug 3, 2026
…ext, storage-free (#3458)

Revives #3354 by @reachjalil onto current dev.

- apps/server: new openwork-cloud-uploads extension (drive_upload_file,
  gmail_create_draft_with_attachments) — authorized workspace paths in,
  multipart FormData out to Den; 4 MiB total enforced before network I/O;
  realpath containment incl. symlink escapes.
- den-api: POST /v1/direct-uploads/google-workspace/{drive-files,gmail-drafts}
  behind new cloudTransportRoute() (MCP bearer + mcp:write + org membership);
  bytes forward straight to Google, never persisted.
- Removes the model-facing base64 lanes: gmail-draft attachments field and the
  drive-files base64 upload capability. Gmail draft logic extracted into
  executeGmailDraft, shared by the JSON capability and the multipart route,
  preserving dev behavior (#3441 binary read lanes and #3449 formatting kept).
- Legacy flow deleted per the frozen corpus; successor proof is
  evals/specs/google-workspace-direct-uploads.slow.test.ts (real Den boot,
  mock-Google byte-exact witness, pre-network 413, no bytes in results).
- evals/tsconfig.json stops typechecking the frozen flow corpus, fixing the
  pre-existing red evals:typecheck (FlowContext.page in den-trim-page-headers).

Co-authored-by: Jalil <[email protected]>

This branch was successfully deployed

5 active deployments
Preview – openwork-den-worker-proxy — ffe3cdcd Deployed Aug 3, 2026 by vercel[bot]
Preview – openwork-landing — ffe3cdcd Deployed Aug 3, 2026 by vercel[bot]
Preview – openwork-den — ffe3cdcd Deployed Aug 3, 2026 by vercel[bot]
Preview – openwork-app — ffe3cdcd Deployed Aug 3, 2026 by vercel[bot]
Preview – openwork-diagnostics — ffe3cdcd Deployed Aug 3, 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