fix: clamp max retries and make shared functions public#3
Merged
AdamFerguson06 merged 1 commit intomainfrom Feb 17, 2026
Merged
fix: clamp max retries and make shared functions public#3AdamFerguson06 merged 1 commit intomainfrom
AdamFerguson06 merged 1 commit intomainfrom
Conversation
- GMAIL_MAX_RETRIES now floors at 0 to prevent empty retry loop that raises a confusing RuntimeError instead of making the API call - Rename 5 underscore-prefixed functions to public names since they are part of the shared API between CLI and MCP server: _fetch_all_messages -> fetch_all_messages _fetch_all_message_ids -> fetch_all_message_ids _parse_headers -> parse_headers _parse_body -> parse_body _format_date -> format_date Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GMAIL_MAX_RETRIESenv var now floors at 0 (negative values causedrange()to produce an empty loop, skipping the API call entirely and raising a confusingRuntimeError)reports.pyto public names since they're used cross-module bymcp_server.py— aligns naming with actual shared API contractTest plan
_decode_bytesremains private (only used within reports.py)🤖 Generated with Claude Code
Note
Low Risk
Mostly safe refactor and config hardening; main risk is accidental breaking change if any external code imported the old underscore-prefixed helper names.
Overview
Prevents misconfiguration by clamping
GMAIL_MAX_RETRIESto a minimum of0, avoiding negative retry counts that could skip API attempts.Promotes previously underscore-prefixed helpers in
reports.pyto public shared helpers (fetch_all_messages,fetch_all_message_ids,parse_headers,parse_body,format_date) and updatesmcp_server.pyand CLI paths to use the new names, aligning the module boundary with actual cross-module usage.Written by Cursor Bugbot for commit 5f6c59d. This will update automatically on new commits. Configure here.