Skip to content

fix(gmail): create attachment drafts through the connector - #4685

Merged
reachjalil merged 2 commits into
devfrom
fix/gmail-attachment-discovery
Sep 9, 2026
Merged

reachjalil merged 2 commits into
devfrom
fix/gmail-attachment-discovery

Conversation

@reachjalil

@reachjalil reachjalil commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

Review update — Verification Incomplete

Current head: 7a644592d; rebased onto dev at 61b41901c.

  • Addressed the CodeQL information-exposure finding in the Gmail journey proxy: failures now return a fixed error code rather than exception text.
  • Focused static review found no additional blocking issue in host fulfillment or selected-account routing. The feature is still absent from current dev and remains worth merging.
  • Passed: TypeScript syntax check of the changed fixture and git diff --check.
  • Runtime tests and local Warden were not run in this fast follow-up. Exact-head verification is Incomplete; the earlier passing evidence below applies only to the old head. Required CI and fresh covering-journey evidence remain prerequisites to merge.
  • Repro: pnpm evals:pr specs/gmail-draft-attachments.test.ts, followed by the repository final-review procedure.

Summary

Make the existing Gmail draft capability discover and fulfill workspace attachments instead of exposing a text-only operation with a separate, easily missed upload path.

  • Add optional attachment paths to the existing capability and generated SDK. No tool rename, compatibility aliases, new OAuth flow, or database migration.
  • Fulfill direct calls through the existing authorized multipart upload transport, preserving the selected Google connection and current member.
  • Use a fixed Gmail-only handoff from the original request. External provider results cannot select actions, paths, or replacement draft fields.
  • Keep workspace authorization, the 10-file/4 MiB limit, draft-only behavior, cancellation propagation, and one-attempt guards. Distinguish definite pre-write rejections from uncertain creation outcomes.
  • Update discovery guidance and document unsupported contexts. REST, Code Mode, saved Workflows, and clients without host fulfillment create no draft when attachments are requested.

Supersedes #3657 with a clean implementation on current dev. It does not incorporate the separate legacy Google retirement work in #4627.

Historical verification — Passed on 5d94841 only

All selected checks passed. The exact-head journey receipt and all five assertion groups are published in the test-evidence comment. Required repository CI runs separately.

Head: 5d94841850fc8959b8b0062f339138d65c358c09
Base: 52a028817ec185df72c28d08bc87db90ba7c71a4

Check Result
pnpm evals:pr specs/gmail-draft-attachments.test.ts 1 passed, 0 failed, 0 skipped; 5 recorded assertion groups
Focused host fulfillment, upload, plugin, and steering tests 80 passed, 0 failed
test/gmail-file-input.test.ts and test/google-workspace-capabilities.test.ts 61 passed, 0 failed, 0 skipped
Server and Den API typechecks Passed
pnpm sdk:check Passed
git diff --check Passed

Journey placement: local PR lane; cold isolated Den and managed engine, synthetic Google and inference witnesses. Runtime: Node 24.11.1, pnpm 11.4.0, Bun 1.3.14, OpenCode 1.18.18. No real Google account was used and no email was sent.

The real search → execute → engine hook → host upload → Den → Gmail witness chain verifies exact CSV/binary attachment bytes, receipt visibility, selected-account isolation, no sends, no inline file bytes in tool context, and rejection of unsafe paths, external handoff spoofing, missing authorization, and unavailable credentials. Each database and host profile was exclusively owned and disposed.

Cancellation and duplicate-call behavior have focused helper and localhost transport coverage; real-engine cancellation during upload is not separately exercised by the journey. Gmail web UI rendering and production rollout are not claimed.

Focused commands

pnpm --filter openwork-server exec bun test src/opencode-plugins/gmail-attachment-fulfillment.test.ts src/extensions/cloud-uploads.test.ts src/opencode-plugins/openwork-extensions-preview.test.ts src/opencode-plugins/openwork-extensions-preview-connect-steering.test.ts
pnpm --filter @openwork-ee/den-api exec bun test --conditions development test/gmail-file-input.test.ts
pnpm --filter @openwork-ee/den-api exec bun test --conditions development test/google-workspace-capabilities.test.ts
pnpm evals:pr specs/gmail-draft-attachments.test.ts

Run the route suite only against an exclusively owned, bootstrapped test database with synthetic credentials. The journey provisions and disposes its own isolated database. Matching host and Cloud support are required for automatic file fulfillment.

@mintlify

mintlify Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
differentai 🟢 Ready View Preview Sep 9, 2026, 5:56 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@vercel

vercel Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
openwork-app Ready Ready Preview Sep 9, 2026 8:48pm UTC
openwork-den Ready Ready Preview Sep 9, 2026 8:48pm UTC
openwork-diagnostics Ready Ready Preview Sep 9, 2026 8:48pm UTC
openwork-landing Ready Ready Preview, v0 Sep 9, 2026 8:48pm UTC

@reachjalil

reachjalil commented Sep 9, 2026 •

Copy link
Copy Markdown
Member Author

Passed · 3/3 tests · 4/4 assertions · 2 images

Commit 7a644592d0aad9ea173c0a52e17ea0d49aa539fb · selected evidence

Open review report

diff-warden[bot]
diff-warden Bot previously approved these changes Sep 9, 2026

@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 blocking findings (security or desktop↔den sync) in this diff (5d94841850fc8959b8b0062f339138d65c358c09). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Warden review summary — Clear

Native findings: 0. Blocking policy matches before consolidation: 0. Full finding text remains in Warden's native checks and review threads. This comment retains only native IDs, severity, skill attribution, and safe locations. Analysis run

Reported trigger coverage (not proof of complete repository or context coverage): diff-security-review (330611 ms), confidentiality-review (452856 ms), spec-provenance-review (464518 ms), desktop-den-sync-review (681138 ms).

Blockers

  • None.

Advisories

  • None.

Needs recheck

  • None.

Observed review-thread metrics

  • Unique observed run attempts in retained window: 1
  • Distinct heads in retained window: 1
  • Current unresolved Warden threads: 0 of 0 observed
  • Observed resolved/unresolved transitions in retained snapshots: 0 / 0
  • First observed resolved/unresolved (state at first collection, not event time): 0 / 0
  • Precision: unavailable (no adjudications; no TP/FP values are inferred)
  • Observation window: 1/20 run attempts retained; truncated: false
  • Transition snapshot: 0/0 current attributed threads retained (limit 500); truncated: false

Thread states are read-only collection snapshots. These metrics are neither lifetime totals nor exact resolution times, and this summary is not clearance authority.

@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 blocking findings (security or desktop↔den sync) in this diff (7a644592d0aad9ea173c0a52e17ea0d49aa539fb). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@reachjalil
reachjalil merged commit d7fb62e into dev Sep 9, 2026
38 checks passed

This branch was successfully deployed

5 active deployments
staging - packages/docs — 7a644592 Deployed Sep 9, 2026 by mintlify[bot]
Preview – openwork-landing — 7a644592 Deployed Sep 9, 2026 by vercel[bot]
Preview – openwork-app — 7a644592 Deployed Sep 9, 2026 by vercel[bot]
Preview – openwork-den — 7a644592 Deployed Sep 9, 2026 by vercel[bot]
Preview – openwork-diagnostics — 7a644592 Deployed Sep 9, 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.

2 participants