Skip to content

fix(gmail): archive complete threads explicitly#762

Merged
steipete merged 1 commit into
mainfrom
fix/gmail-archive-thread-752
Jun 12, 2026
Merged

fix(gmail): archive complete threads explicitly#762
steipete merged 1 commit into
mainfrom
fix/gmail-archive-thread-752

Conversation

@steipete

Copy link
Copy Markdown
Collaborator

Summary

  • add explicit gmail archive --thread <threadId>... semantics using Gmail users.threads.modify
  • preserve existing positional message-ID and --query behavior unless --thread is set
  • reject ambiguous --thread --query combinations before auth
  • continue across per-thread API failures, emit retry-safe per-thread JSON/plain results, then return nonzero for partial failure
  • update generated command docs and changelog

Closes #752.

Verification

  • focused archive dry-run, API request, normalization, query-conflict, success-output, and partial-failure tests
  • full make ci (629 generated command pages, 23 feature pages)
  • structured autoreview: clean after adding retry-safe partial-failure reporting
  • live Gmail E2E with clawdbot@gmail.com and sending disabled:
    • selected an existing two-message test thread with no INBOX labels
    • added INBOX to the whole thread and verified both messages entered the inbox
    • ran gmail archive --thread; verified both messages lost INBOX
    • verified JSON count/failure/result fields
    • verified final message labels exactly matched the original state

CLI contract

--thread applies only to positional IDs. Gmail message and thread IDs are opaque, so the command does not guess their type. --query retains message-level semantics.

Risk

Low/medium. The behavior is additive and explicit. Multiple thread API calls are not atomic; partial outcomes are fully reported and the command exits nonzero when any thread fails.

@steipete steipete merged commit 3f653c7 into main Jun 12, 2026
12 of 13 checks passed
@steipete steipete deleted the fix/gmail-archive-thread-752 branch June 12, 2026 02:15
@steipete

Copy link
Copy Markdown
Collaborator Author

Landed as 3f653c7.

Proof:

  • focused dry-run, normalization, API request, query-conflict, success, and partial-failure tests pass
  • full make ci pass; 629 generated command pages and 23 feature pages
  • autoreview found partial-failure retry ambiguity; fixed with per-thread continuation/results and nonzero summary; final autoreview clean
  • exact-head CI green on duplicate Linux, Windows, Darwin/cgo, worker, and Docker checks; one hung Windows runner was cancelled and rerun successfully
  • live Gmail E2E with sending disabled: added INBOX to both messages in an existing two-message test thread, gmail archive --thread removed it from both, JSON reported success, and final labels exactly matched the original state

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.

bug(gmail archive): given a thread ID, archives only one message but reports success (no thread-level archive)

1 participant