Skip to content

Add Gmail remote draft edit/send support - #170

Merged
mohammedahmed18 merged 25 commits into
mainfrom
codex/gmail-remote-draft-edit-send
Aug 6, 2026
Merged

Add Gmail remote draft edit/send support#170
mohammedahmed18 merged 25 commits into
mainfrom
codex/gmail-remote-draft-edit-send

Conversation

@mohammedahmed18

@mohammedahmed18 mohammedahmed18 commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Project remote Gmail drafts under draft/ with stable gmail-draft: ids while keeping outbox/ as the direct-send staging surface.
  • Support Gmail draft update and draft-to-outbox send push flows, including connector guidance/docs and live Gmail script coverage.
  • Prune clean local draft projections when a previously pulled Gmail draft no longer appears in remote draft listings, including mounted Linux FUSE views.
  • Repair legacy Gmail draft message-id state safely across pull, scheduled reconcile, virtual refresh, and repeated scheduled pass preservation cases.
  • Preserve the current remote draft subject when sending a moved draft from outbox/ without an explicit subject edit.
  • Enable the protected connector live Gmail workflow to run the real send-gated E2E path on main/manual runs.

Test Plan

  • cargo fmt --all --check
  • git diff --check
  • bash -n tests/live_connector_common.sh tests/live_connector_common_selftest.sh tests/live_gmail_vfs_roundtrip.sh
  • LOCALITY_LIVE_COMMON_SELFTEST=1 tests/live_connector_common_selftest.sh
  • LOCALITY_LIVE_GMAIL_SELFTEST=1 tests/live_gmail_vfs_roundtrip.sh
  • cargo test -p locality-fuse
  • cargo test -p localityd pull::tests -- --nocapture
  • cargo test -p localityd
  • LOCALITY_LIVE_GMAIL_VFS=1 LOCALITY_LIVE_GMAIL_SEND=1 LOCALITY_GMAIL_LIVE_CONNECTION_ID=gmail-default LOCALITY_GMAIL_LIVE_MOUNT_ID=gmail-live LOCALITY_GMAIL_LIVE_TO_EMAIL=mohammed182001180@gmail.com LOCALITY_GMAIL_LIVE_CREDENTIAL_JSON=<refreshed ali@codeflash.ai credential> tests/live_gmail_vfs_roundtrip.sh
  • cargo test -p localityd reconcile::tests::scheduled_pull_gmail_draft -- --nocapture
  • cargo test -p localityd pull::tests::pull_gmail_draft -- --nocapture
  • cargo test -p localityd virtual_fs::tests::refresh_children_repairs_legacy_gmail_draft_message_id_collision -- --nocapture
  • cargo test -p locality-store
  • cargo test -p locality-gmail
  • cargo test -p localityd --test source_descriptor
  • cargo test -p localityd --test push_preparation
  • cargo test -p localityd --test push_execution
  • cargo test -p loc-cli --test mount mount_writes_gmail_attachment_guidance
  • cargo test -p locality-desktop agent_guidance::tests::skill_teaches_connector_aware_locality_cli_workflow
  • cargo test -p localityd push::tests
  • cargo test -p loc-cli --test status
  • LOCALITY_LIVE_GMAIL_VFS=0 tests/live_gmail_vfs_roundtrip.sh (skip path)
  • cargo test --workspace -- --test-threads=1
  • python3 -c 'import yaml; yaml.safe_load(open(".github/workflows/connector-live-e2e.yml", encoding="utf-8")); print("yaml ok")'

Live Verification Notes

  • Real Gmail API, CLI, daemon, and Linux FUSE draft, direct-send, stale draft prune, remote draft edit, and remote draft send checks passed against ali@codeflash.ai.
  • Verified the exact stale-draft path: create draft via mounted draft/, push, pull draft/, send that draft through Gmail drafts API outside the local folder, pull draft/ again, and confirm the stale mounted draft path and marker disappear.
  • Gmail OAuth scopes allow compose/send but do not allow trashing sent scratch messages, so final sent-message cleanup is best-effort and emitted warnings during the run.
  • The live connector helper now rebuilds default target/debug binaries before live runs, avoiding stale cached locality-fuse binaries in local or cached CI runs.
  • GitHub's connector-live-e2e Gmail job sets LOCALITY_LIVE_GMAIL_SEND=1, so the protected live workflow covers the send path on main/manual runs.

Review

  • Subagent spec review approved.
  • Final code-quality review approved after fixing the repeated scheduled reconcile legacy-stub preservation issue.

@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
locality Ready Ready Preview Aug 6, 2026 10:57am

@mohammedahmed18 mohammedahmed18 changed the title WIP: Add Gmail remote draft edit/send support Add Gmail remote draft edit/send support Aug 4, 2026
@mohammedahmed18
mohammedahmed18 marked this pull request as ready for review August 4, 2026 17:16
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codex review

No high-confidence issues found.

@mohammedahmed18
mohammedahmed18 merged commit a5fa41a into main Aug 6, 2026
12 checks passed
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