Skip to content

Improve Gmail threads.list and threads.get conformance#27

Open
Bbbstin wants to merge 12 commits into
benchflow-ai:mainfrom
Bbbstin:bbbstin/improve-gmail-threads-conformance
Open

Improve Gmail threads.list and threads.get conformance#27
Bbbstin wants to merge 12 commits into
benchflow-ai:mainfrom
Bbbstin:bbbstin/improve-gmail-threads-conformance

Conversation

@Bbbstin

@Bbbstin Bbbstin commented Jul 12, 2026

Copy link
Copy Markdown

Summary

  • make threads.list deterministic by ordering threads by their latest visible member message, falling back to the latest member for fully hidden threads, with a stable thread ID tie-breaker before offset pagination; persisted Thread rows with no member messages are no longer listed
  • align threads.list label filtering with Gmail by requiring one member message to satisfy all requested labelIds
  • align threads.get with the read contract by ordering messages deterministically, limiting format to full, metadata, and minimal, and treating the same empty-thread orphan state as not found
  • add focused behavior coverage for thread-wide search, same-message multi-label filtering, includeSpamTrash, result estimates, pagination, same-subject thread identity, formats, and orphan handling
  • strengthen conformance coverage with sanitized provider fixtures for list, full, metadata, minimal, mixed Trash/Spam ordering, and multi-label filtering

Validation

  • cd packages/environments/mock-gmail && uv run --extra dev pytest tests/test_conformance.py -q (43 passed)
  • cd packages/environments/mock-gmail && uv run --extra dev pytest tests -q (260 passed)
  • git diff --check

Notes

  • sanitized real Gmail captures back the list, full, metadata, and minimal response shapes, mixed Trash/Spam ordering, and same-message multi-label filtering; official Gmail documentation backs thread-wide search and the supported get formats
  • no Gmail credentials, OAuth tokens, raw account identifiers, or unsanitized captures are tracked
  • this branch is based directly on main and is independent of Fix Gmail multi-label filtering #26 (both touch tests/test_api.py, but in unrelated tests: Fix Gmail multi-label filtering #26 adds message-list filtering coverage, while this PR only makes the thread-deletion setup deterministic)
  • scripts/smoke_dev.sh and Docker/base-image checks are not applicable because this PR does not change launcher, control, devhub, Docker, or base-image behavior
  • no Web UI, write-side message or draft behavior, seed data, database schema, attachment/history/snapshot behavior, or security-sensitive ownership logic is changed

Bbbstin added 12 commits July 12, 2026 20:03
Threads with no messages are no longer listed because they have no latest-message timestamp.
Capture a sanitized two-message provider response and verify the minimal message shape and order against it.
Prefer the latest visible message date, falling back to the latest member for fully hidden threads. Add sanitized provider captures and regression coverage.
Record sanitized read-side captures for a mixed Spam thread and extend hidden-message regression coverage across Trash and Spam.
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