Add archive command - #1
Conversation
Adds gmail archive <message-id>... which removes the INBOX label, matching Gmail archive behavior. Adds gmail.modify scope to support this. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
a8915a9 to
01a6fdd
Compare
The archive branch swapped the HTML-to-markdown dependency from html_to_markdown to markdownify. markdownify is declared in neither pyproject.toml nor uv.lock, so `gmail read` raised ModuleNotFoundError on any HTML email. The swap is also unrelated to the archive feature. Claude-Session: https://claude.ai/code/session_01XN4T96G5R4UczQpgA2nqES
An invalid message ID raised HttpError out of the loop, so IDs before it were already archived while IDs after it silently never ran. Report the failure, continue the batch, and exit non-zero. Claude-Session: https://claude.ai/code/session_01XN4T96G5R4UczQpgA2nqES
Adding gmail.modify invalidates every existing token, but the old token still refreshes cleanly, so the API rejected archive with an opaque 403. Credentials.from_authorized_user_info() overrides a token's scopes with the ones passed in, so creds.scopes cannot detect this - read the granted scopes from the token file and re-consent when any required scope is absent. Claude-Session: https://claude.ai/code/session_01XN4T96G5R4UczQpgA2nqES
|
Thanks for this — the archive command itself is clean and matches the project style. I've reviewed it and pushed a few fix commits to the branch ( One thing I want to ask you about directly. The diff carries a change to -from html_to_markdown import convert_to_markdown
+from markdownify import markdownify as convert_to_markdown
It also isn't mentioned in the PR description, which is what makes me want to raise it rather than just quietly drop it. My assumption is that this was errant — a leftover from a local experiment, or a branch that picked up an unrelated change — and I've reverted it in 57e934d on that basis. Can you confirm? Two reasons I'd rather ask than assume silently:
The rest of what I pushed, for the record:
Worth knowing: this branch will conflict with #2 and #3, which touch the same region of |
Summary
gmail archive <message-id>...command that removes the INBOX label, matching Gmail native archive behaviorgmail.modifyOAuth scope to support label modificationTest plan