Repository navigation
Conversation
Current Gmail web URLs carry an opaque view token (#inbox/FMfcgz...) instead of the hex thread ID, so pasting them into thread/message commands fails with 400 Invalid id value. The token is a base64 string re-encoded in a consonant-only base-40 alphabet whose payload is f:/thread-f:/msg-f:<decimal id>; decode it offline in the existing Gmail ID normalizers.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
Codex review: needs real behavior proof before merge. What this changesThis PR decodes Gmail web view tokens into hexadecimal API IDs in the shared thread and message normalizers. Example: Pass https://mail.google.com/mail/u/0/#inbox/FMfcgzGwHpVzSvQjBWlWNGBCZqCPPPMN to gmail thread get.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep this PR open: current main still lacks opaque Gmail token decoding, and the focused implementation addresses that gap; one changelog policy correction remains. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherGmail CLI commands pass user-supplied IDs and URLs through shared normalizers before authenticated Gmail API requests; this change adds offline token decoding at that existing boundary. flowchart LR
A[CLI ID or Gmail URL] --> B[Shared ID normalizer]
B --> C[Existing hexadecimal extraction]
B --> D[Opaque token decoder]
C --> E[Thread or message API ID]
D --> E
E --> F[Authenticated Gmail API request]
Technical reviewBest possible solution: Extend the existing shared normalizers with resource-specific offline decoding while preserving hexadecimal IDs and unchanged fallback behavior. Do we have a high-confidence way to reproduce the issue? Source establishes the failure path: current main returns an opaque-token URL unchanged, and thread retrieval sends that value as the Gmail API ID; no target code was executed. Is this the best way to solve the issue? The shared normalizers are the appropriate owner, and the decoding algorithm matches the contributor-cited reference without adding dependencies, flags, or a competing resolution path. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e8428c36dd31. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 10, 2026, 5:05 AM ET / 10:05 UTC. |
Summary
Current Gmail web URLs carry an opaque view token instead of the hex ID:
Passing such a URL or token to
gmail thread get,gmail get, etc. fails with400 invalidArgument: Invalid id value, becausenormalizeGmailThreadID/normalizeGmailMessageIDonly recognise hex IDs.The token is a base64 string re-encoded in the consonant-only base-40 alphabet
BCDFGHJKLMNPQRSTVWXZbcdfghjklmnpqrstvwxz. Its payload isf:<decimal>orthread-f:<decimal>for threads andmsg-f:<decimal>for messages; the decimal is the API ID. This PR decodes the token offline (no API call) in the existing normalizers, both for bare tokens and for the last fragment segment of a Gmail URL. Thread tokens only resolve in thread normalization andmsg-ftokens only in message normalization; anything that does not decode to a known prefix is passed through unchanged as before.The scheme matches the Gmail parser in Unfurl.
User-facing change
Gmail commands that take a thread or message ID now also accept current Gmail web URLs and their bare view tokens. No new flags.
Testing
webid_test.go: thread and message cases for bare tokens,#inbox/…and#label/…?compose=newURLs, thethread-f:variant, cross-kind rejection (amsg-ftoken is not a thread ID and vice versa), and a non-decodable consonant string. The new cases fail onmainand pass with this change.#inbox/FMfcgz…URL from my mailbox: it decodes to the hex ID thatgmail searchreturns for the same message, andgog gmail thread get <hex>fetches it.make fmt-check lint deadcode test docs-check agent-skills-checkall pass locally (one earliermake testrun reported aFAILthat did not reproduce on rerun; the keyring timeout tests seemed to be the flaky part).