Skip to content

fix email formatting for gmail client#191

Merged
luke-lombardi merged 1 commit intomainfrom
ll/fix-email-formatting
Apr 7, 2026
Merged

fix email formatting for gmail client#191
luke-lombardi merged 1 commit intomainfrom
ll/fix-email-formatting

Conversation

@luke-lombardi
Copy link
Copy Markdown
Contributor

@luke-lombardi luke-lombardi commented Apr 7, 2026

Summary by cubic

Send HTML emails from the Gmail client so messages render correctly in Gmail (paragraphs, lists, and links). Also improves relevance when pulling view data and prevents cross-sheet writes to unrelated sheets.

  • Bug Fixes

    • Gmail: set Content-Type: text/html and convert plain text to simple HTML (paragraphs, bullets/numbered lists, auto-linked URLs, mobile viewport). Tests added in pkg/tools/clients/gmail_test.go.
  • New Features

    • Context enrichment: FetchViewRows now accepts a queryHint and uses vector search when available; otherwise pages the first table only. Callers pass the composed message as the hint for better relevance.
    • View data context: add per-sheet character budgets to avoid overlong contexts.
    • Embeddings: add BulkUpdateEmbeddings to persist embeddings without clobbering cells; used by async row embedding.
    • View sync: filter cross-sheet targets by minimum column overlap to avoid inserting into unrelated sheets; make tool-write sync run async to reduce latency.

Written for commit 9cbb912. Summary will update on new commits.

@luke-lombardi luke-lombardi merged commit 41ac927 into main Apr 7, 2026
4 checks passed
@luke-lombardi luke-lombardi deleted the ll/fix-email-formatting branch April 7, 2026 22:18
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

✅ Integration Tests PASSED

Gateway: https://api.airstore.ai
Query path: /sources/gmail/unread-emails
Timestamp: 2026-04-07T22:18:31Z

I/O Smoke Tests

Test Status Latency Bytes
list_sources PASS 372ms -
list_gmail PASS 410ms -
list_query_path PASS 606ms -
read_file PASS 419ms 1,724
stat_file PASS 294ms 69,626

Compression A/B Tests

Metric Value
Files tested 8
Total raw bytes 73,033
Total strip bytes 46,330
Total raw tokens 41,729
Total strip tokens 27,530
Tokens saved 14,199
Byte reduction 36%
Token reduction 34%
Min threshold 10%
Cache consistent Yes
Per-file results
File Raw B Strip B Raw Tok Strip Tok Tok Saved Red% Raw ms Strip ms
2024-10-15_Harris-Walz_Organizing_Tea... 2,337 2,305 976 967 9 1% 442ms 299ms
2024-10-15_Stephen_King_via_KamalaHar... 2,904 2,866 1,116 1,103 13 1% 402ms 304ms
2025-07-17_KAYAK_How_to_have_everythi... 1,724 1,670 1,220 1,204 16 3% 296ms 300ms
2025-07-17_Alamo_Drafthouse_Cinema_Th... 19,047 18,224 12,228 11,704 524 4% 520ms 370ms
2025-07-17_Alamo_Drafthouse_Cinema_Th... 18,978 18,155 12,105 11,578 527 4% 502ms 396ms
2024-10-15_Knut_at_Sanity_Join_us_tom... 1,272 726 504 209 295 42% 423ms 298ms
2025-07-17_Lindsay_Stanley_TODAY_Conf... 1,876 1,049 657 268 389 44% 413ms 294ms
2025-07-17_NORDSTROM_RACK_FLASH_Travi... 24,895 1,335 12,923 497 12,426 94% 527ms 306ms

Charts

Overall Compression
Raw vs Compressed Bytes
Token Comparison
Reduction by File
Read Latency
I/O Latency

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