Skip to content

Add composio gmail_sync_query to scope background Gmail ingestion - #5740

Draft
nocstah wants to merge 1 commit into
tinyhumansai:mainfrom
nocstah:feat/composio-gmail-sync-query
Draft

Add composio gmail_sync_query to scope background Gmail ingestion#5740
nocstah wants to merge 1 commit into
tinyhumansai:mainfrom
nocstah:feat/composio-gmail-sync-query

Conversation

@nocstah

@nocstah nocstah commented Aug 24, 2026

Copy link
Copy Markdown

Draft — blocked on tinyhumansai/tinymemory#94. This is the host half of the feature; it does not compile until the tinymemory PR (which adds ComposioMode.gmail_sync_query + the pipeline filter) merges and the vendor/tinymemory submodule pointer is bumped here. I'll push the bump and mark ready-for-review when #94 lands.

Summary

  • New [composio] gmail_sync_query config field: a Gmail search query (e.g. label:brain, from:someone, newer_than:30d) that scopes the background Gmail→memory sync to matching messages only.
  • Plumbed ComposioConfig → memory host ComposioMode.gmail_sync_query → tinymemory's Gmail pipeline standing filter (Add a standing Gmail search filter that scopes background sync tinymemory#94), which ANDs it with the incremental after:<cursor> clause — scoped sync stays incremental.
  • On-demand agent access to Gmail is unaffected; this gates only what auto-ingests into memory.

Problem

With a Composio Gmail connection and sync enabled, the pipeline ingests the whole inbox window. Users who want the assistant to know only selected mail (privacy, noise, cost) have no content-level control — only quantity caps (max_items / sync_depth_days). The natural workflow — label an email in Gmail (or let Gmail filters auto-label categories) and have exactly those flow into memory — needs a standing query filter.

Solution

One additive config field, defaulting to empty (today's whole-window behavior). Empty/whitespace normalizes to None at the host boundary; the pipeline-side semantics (compose-with-cursor vs with_query's replace-for-backfills) live in the tinymemory PR with 4 tests.

Submission Checklist

If a section does not apply to this change, mark the item as N/A with a one-line reason. Do not delete items.

  • Tests added or updated (happy path + at least one failure / edge case) per Testing Strategy — clause composition, empty-filter, and override-semantics tests live with the pipeline change in tinymemory#94; host side is serde default + trim-to-None plumbing
  • Diff coverage ≥ 80% — to be confirmed by CI once unblocked
  • Coverage matrix updated — N/A: additive config field
  • All affected feature IDs from the matrix are listed in the PR description under ## RelatedN/A
  • No new external network dependencies introduced (mock backend used per Testing Strategy)
  • Manual smoke checklist updated if this touches release-cut surfaces — N/A
  • Linked issue closed via Closes #NNN in the ## Related section — N/A: feature, discussed in #5731's context

Impact

  • Desktop, Composio Gmail users (both backend and direct modes): opt-in content-scoped ingestion. Default behavior unchanged.

Related


AI Authored PR Metadata (required for Codex/Linear PRs)

Linear Issue

  • Key: N/A
  • URL: N/A

Commit & Branch

  • Branch: feat/composio-gmail-sync-query
  • Commit SHA: 769fad2

Validation Run

  • pnpm --filter openhuman-app format:check — N/A: Rust-only change
  • pnpm typecheck — N/A: Rust-only change
  • Focused tests: full flow validated on a build carrying both halves (pipeline tests in tinymemory#94: 17 gmail tests pass)
  • Rust fmt/check (if changed): blocked — does not compile until the submodule bump (see draft note)
  • Tauri fmt/check (if changed): N/A

Validation Blocked

  • command: cargo check --lib
  • error: ComposioMode has no field gmail_sync_query until tinymemory#94 merges
  • impact: draft until the dependency lands; validated end-to-end locally against the paired tinymemory branch

Behavior Changes

  • Intended behavior change: optional content-scoped Gmail sync.
  • User-visible effect: with gmail_sync_query = "label:brain", only labeled mail enters memory.

Parity Contract

  • Legacy behavior preserved: empty field ⇒ exact current whole-window sync.
  • Guard/fallback/dispatch parity checks: trim-to-None at the host boundary; pipeline tests pin composition semantics.

Duplicate / Superseded PR Handling

  • Duplicate PR(s): none known
  • Canonical PR: this
  • Resolution (closed/superseded/updated): N/A

🤖 Generated with Claude Code

https://claude.ai/code/session_01UMNxXS5ucxpzNoHnuhyQPu

New [composio] gmail_sync_query config field (e.g. 'label:brain'),
plumbed ComposioConfig -> memory host ComposioMode.gmail_sync_query ->
tinymemory's Gmail sync pipeline filter. Only matching messages
auto-ingest into memory; on-demand Gmail access is unaffected.

Blocked on tinyhumansai/tinymemory#94 (the pipeline half); the
vendor/tinymemory submodule bump follows once that merges.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UMNxXS5ucxpzNoHnuhyQPu
@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Warning

Your free Security trial is over. An organization admin can activate billing to continue.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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