Skip to content

fix: skip malformed parts and missing threads, decode declared charsets - #13

Merged
TheGreatAxios merged 1 commit into
cl-9439-google-tools-reply-draft-headersfrom
cl-9440-google-tools-tolerate-bad-parts-and-missing-threads
Sep 27, 2026
Merged

TheGreatAxios merged 1 commit into
cl-9439-google-tools-reply-draft-headersfrom
cl-9440-google-tools-tolerate-bad-parts-and-missing-threads

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Closes CL-9440

  • Message bodies: a part with malformed base64 is skipped rather than failing the whole gmail_get_message/gmail_get_thread call. Text is decoded with the part's Content-Type charset through TextDecoder, and an unknown label is decoded as UTF-8.
  • gmail_search_threads: a thread that returns 404 between the list and the lookup is left out of the page. Any other error still fails the call.

Every tool still asks for approval, and the public API is unchanged.

Tests in src/tools/create-tools.test.ts cover a 404 thread in a search page, and a message with a Latin-1 part plus a malformed part. Both failed before the fix.

@TheGreatAxios
TheGreatAxios added this pull request to stack #9 September 27, 2026 00:46
@TheGreatAxios
TheGreatAxios merged commit e23fba0 into main Sep 27, 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.

1 participant