Skip to content

LiveGmailProbe and the README for Gmail (OP2-284) - #12

Merged
BrewingCoder merged 1 commit into
mainfrom
claude/op2-284-gmail-probe-docs
Nov 3, 2026
Merged

BrewingCoder merged 1 commit into
mainfrom
claude/op2-284-gmail-probe-docs

Conversation

@BrewingCoder

Copy link
Copy Markdown
Owner

OP2-284, Gmail subtask 7 of 7: the live probe, and the README. Everything in #8 to #11 was written against Google's documentation and documented response shapes. This PR adds the test that checks it against a real account, and updates the docs to describe what was built, honestly.

The README marks Gmail "built against the Gmail API documentation; live verification pending." Once LiveGmailProbe has passed on your machine, change that row to done. The ticket's done-when is "no claim the probe hasn't verified", and it hasn't run yet.

LiveGmailProbe

Alongside the other Live* probes, and skipping (not failing) unless the environment is there:

  • the dev Vault and database;
  • a Google OAuth client in ~/.claude/credentials.json, as outpost2_google_client_id and outpost2_google_client_secret;
  • a Gmail connection made through the app. OP2_PROBE_LABEL picks one by name.

It has three tests, in increasing order of consequence.

  1. Reading. Runs every time.

    • A cold access token from the stored refresh token (OP2-279's refresh path).
    • The inbox, newest first, with real received times.
    • A full read whose body has no HTML or   left in it.
    • Two search pages with nothing repeated, the second resumed with a different query that must be ignored.
    • Labels as folders with counts, including Inbox and Trash, and without Starred, Unread or Important.
    • An attachment's bytes opened twice and compared. Gmail issues a new attachment id on every fetch, and opening by part id has to survive that.
  2. Organising, undone. Runs every time. On the newest inbox message:

    • star, then restore;
    • toggle read state, then restore;
    • make a temporary label Outpost probe <timestamp> and apply it as a category, checking the message is still in the Inbox;
    • move the message to that label, checking it's out of the Inbox, then move it back.

    In a finally, the label comes off and is deleted, and the message's labels are checked identical to before. Every check reads Gmail's own record of the labels (format=minimal), not what the tools claim.

  3. Sending. Opt-in with OP2_PROBE_SEND=1.

    • Sends high-importance mail to the account itself and waits for it to arrive. Importance must read back as high, and the body must survive.
    • Replies, and checks that Re: isn't doubled and that both messages share one Gmail thread.
    • Moves the message to Trash and back.
    • Then moves the probe's own messages to Trash.

    It never mails anybody else. It's opt-in because a test that sends every time it runs is a test that gets disabled.

README

  • "58 tools across four providers", and the design note now covers routing mail by provider.
  • What Gmail serves and how it differs: labels not folders (move, archive, categorise, delete-no-mail), Trash and Spam, stars without due dates, importance shown in Outlook but not in Gmail, no sender blocking, and times in UTC.
  • Setting up the Google OAuth client, and Testing mode: only listed test users can connect, and sign-ins expire after seven days. The README says the resulting "reconnect" is that limit, not a fault (OP2-283).
  • Running the probe, including the opt-in for sending.
  • Status: Gmail as live verification pending; Gmail for users outside a test list as blocked on OP2-283; Atlassian and Azure DevOps still planned.
  • Gotchas: Gmail's documented quirks (offline access and consent for refresh tokens, per-fetch attachment ids, page-token scope, maxResults=0 rejected), flagged as documented and not yet hit live.
  • The test count is updated to 1,076.

Testing

All three probe tests skip here, as designed: there's no dev Vault in this environment. They can only really run against your account. Full suite: 1,076 tests; only the 20 Vault-dependent web-host tests fail, as on main in this environment.

To run it locally

dotnet test --filter "FullyQualifiedName~LiveGmailProbe"
OP2_PROBE_SEND=1 dotnet test --filter "FullyQualifiedName~LiveGmailProbe"

The first command runs reading and organising; the second adds sending. Running them with --logger "console;verbosity=detailed" prints what was seen at each step.


Generated by Claude Code

A live probe for the Gmail work in OP2-279..282, and the README updated to
say what that work is - and that its live verification is still to come.

LiveGmailProbe skips unless the dev Vault and database, a Google OAuth
client in ~/.claude/credentials.json (outpost2_google_client_id/_secret)
and a Gmail connection are there; OP2_PROBE_LABEL picks one.
- Reading, always: a cold token from the stored refresh token, the inbox in
  order, a full read with no HTML left, two search pages with nothing
  repeated, labels with counts (and without Starred/Unread/Important), and
  an attachment's bytes opened twice to prove part ids survive Gmail's
  per-fetch attachment ids.
- Organising, undone, always: star, read state, a temporary label as a
  category (still in the Inbox) and as a folder (out of it), back to the
  Inbox; the label deleted and the message's labels checked identical to
  before, against Gmail's own record of them.
- Sending, only with OP2_PROBE_SEND=1: high-importance mail to itself, read
  back, a reply that must share its thread, Trash and back, then the probe's
  own messages to Trash. It never mails anybody else.

README: four providers; what Gmail serves and how it differs (labels,
Trash/Spam, stars, importance headers, no sender blocking, UTC times);
setting up the Google OAuth client and Testing mode's seven-day limit;
running the probe; the status row marked "live verification pending"
rather than done; Gmail's documented gotchas, flagged as documented; the
test count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V7aurkG6ivoSJf2yFGtzi8
@BrewingCoder
BrewingCoder merged commit b122e7c into main Nov 3, 2026
1 check 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.

2 participants