Skip to content

fix: correct Gmail retries, queries, and Drive output - #1253

Merged
steipete merged 2 commits into
mainfrom
fix/round16-bugs
Oct 23, 2026
Merged

steipete merged 2 commits into
mainfrom
fix/round16-bugs

Conversation

@steipete

@steipete steipete commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Several existing Gmail and Drive paths silently lose information or do unnecessary work after failure. This consolidates the reproduced fixes from #1242, #1246, #1247, #1248, and #1250, with contributor credit preserved.

  • Retry Google's short-term 403 rate-limit reasons using the existing bounded backoff and shared 429 budget. Preserve response bytes/read errors and stop pending Gmail detail fetches after the first failure. Gmail watch also opens its circuit for these 403s. Addresses gmail search fails on the first 403 rateLimitExceeded, without backoff, and keeps fetching after it has failed #1241.
  • Keep quoted Gmail operators as query text rather than adding an unintended label filter.
  • Retain requested false booleans in Drive/Sites list JSON, including grouped selectors, slash paths, and wildcards; preserve omission of conditional fields.
  • Show nonempty Cc/Bcc headers in thread text output.
  • Isolate reply/forward header direction in HTML and add Gmail's quote classes, preserving plain text and the original quoted HTML.

Failing regression tests reproduced all five behaviors before the fixes. Focused transport, concurrency, query, Drive, thread, and quote tests pass. Independent Codex review found no actionable P0–P2 findings. The full make ci gate passes on Linux. govulncheck reports zero reachable vulnerabilities and no vulnerable imported packages; its module-only GO-2026-5932 advisory concerns unused x/crypto/openpgp. All exact-head CI checks passed at 5f4a77521089775e71b333019eba569a6edeeb14: run 39888593907, including Linux, Windows, macOS, minimum Go, and the tracking worker. Docker and CodeQL also passed.

The following existing synthetic Gmail Web captures are from @malob's proof in #1250. They use example addresses and show the same forward before and after direction isolation.

Before After
Forward header before direction isolation Forward header after direction isolation

Thanks @xyrolle, @SebTardif, @alexpriest, and @malob.

steipete and others added 2 commits October 22, 2026 19:15
Back off on retryable 403 responses, cancel failed Gmail detail fan-outs, preserve requested Drive false booleans, leave quoted Gmail operators to the provider, display Cc/Bcc in threads, and isolate quote header direction in HTML. Consolidate the verified fixes from #1242, #1246, #1247, #1248 and #1250.

Co-authored-by: Serghei <xyrolle@gmail.com>
Co-authored-by: Sebastien Tardif <SebTardif@ncf.ca>
Co-authored-by: Kit <kit@alexpriest.com>
Co-authored-by: Malo Bourgon <mbourgon@gmail.com>
@clawsweeper

clawsweeper Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T02:17:54.013335Z 5f4a775 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal priority bug or improvement with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 23, 2026
@clawsweeper

clawsweeper Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR repairs Google rate-limit retries, Gmail search and quote handling, missing thread recipients, and false booleans in Drive list JSON.

Example: Run gog drive ls --fields 'files(id,trashed)' --json for file f1 whose trashed value is false.

  • Before: The file object omits trashed.
  • After: The file object includes "trashed": false.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful repairs with strong inherited CLI and visual evidence, focused regression coverage, green current-head checks, and no actionable findings; runtime evidence does not cover every changed path.
Proof confidence 🐚 platinum hermit (4/6) Collaborator authorship exempts this PR from the ordinary contributor proof gate; inspected inherited evidence exercises Linux retry recovery through the production HTTP client, Windows Drive/query CLI behavior, and live Gmail quote rendering and draft readback, with the remaining runtime coverage limits recorded above.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Users encounter avoidable throttling failures, silently narrowed searches, missing file flags and recipients, and scrambled quoted headers beside right-to-left names.
Reason: The collaborator-authored consolidation authorizes the direction and repairs demonstrated failures using existing product contracts.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it fixes concrete gaps still present on main, has maintainer-approved direction, and introduces no actionable defect found in this review.

Priority: P2
Reviewed head: 5f4a77521089775e71b333019eba569a6edeeb14

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Separate runtime traces are absent for message-search cancellation, the 403 watch circuit, and thread Cc/Bcc output; these have inspected regression coverage.
Agent review details

How this fits together

Workspace CLI commands use Google API clients and shared retry transport, then render search results, file JSON, thread headers, or quoted email; Gmail watch also classifies failures through its existing account circuit.

flowchart LR
A[Workspace CLI] --> B[Command handlers]
B --> C[Google retry transport]
C --> D[Google APIs]
D --> E[JSON and text output]
B --> F[Reply and forward formatting]
G[Gmail watch processor] --> C
G --> H[Account rate limit circuit]
Loading

Technical review

Best possible solution:

Land the repairs through the existing retry, search, list-output, watch-circuit, and quote-formatting owners.

Do we have a high-confidence way to reproduce the issue?

Main source establishes the reported paths, and linked submissions provide failing regressions and CLI reproductions; no target code was executed during this read-only review.

Is this the best way to solve the issue?

The patch fixes the responsible shared owners, retains their existing safety checks and output contracts, and adds no competing implementation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 3ba47bd1ef39.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 65e1c85 adds internal/googleapi/transport.go:150 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 65e1c851ee5f; files: internal/googleapi/transport.go)
  • Malo Bourgon: Raw commit 9d76657 adds internal/cmd/gmail_quote_mailbox.go:125 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9d76657d0d80; files: internal/cmd/gmail_quote_mailbox.go)
  • Sebastien Tardif: Raw commit 0fcaeb9 adds internal/cmd/gmail_thread_search_helpers.go:296 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 0fcaeb949fd1; files: internal/cmd/gmail_thread_search_helpers.go)
  • wstock: Raw commit 70eb64a adds internal/cmd/gmail_search_labels.go:100 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 70eb64ac7892; files: internal/cmd/gmail_search_labels.go)
  • postoso: Raw commit bfac16e adds internal/cmd/drive_fields.go:36 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: bfac16e00c98; files: internal/cmd/drive_fields.go)

Review metrics

Metric Value Why it matters
Change distribution Production +247/-49; tests +664/-94; docs and changelog +23/-8 Most growth covers distinct retry, body-preservation, cancellation, field-mask and quote-rendering failures while updating existing fixtures.

Root-cause cluster

Relationship: canonical
Canonical: #1253
Summary: This PR consolidates five source-verified repairs with distinct causes and preserves contributor credit.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add P2: The repairs address bounded reliability and output-correctness failures without evidence of an urgent widespread outage.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: The repairs address bounded reliability and output-correctness failures without evidence of an urgent widespread outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 22, 2026, 10:29 PM ET / October 23, 2026, 02:29 UTC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant