Skip to content

fix: clamp max retries and make shared functions public#3

Merged
AdamFerguson06 merged 1 commit intomainfrom
fix/bugbot-review-fixes
Feb 17, 2026
Merged

fix: clamp max retries and make shared functions public#3
AdamFerguson06 merged 1 commit intomainfrom
fix/bugbot-review-fixes

Conversation

@AdamFerguson06
Copy link
Copy Markdown
Owner

@AdamFerguson06 AdamFerguson06 commented Feb 17, 2026

Summary

  • GMAIL_MAX_RETRIES env var now floors at 0 (negative values caused range() to produce an empty loop, skipping the API call entirely and raising a confusing RuntimeError)
  • Renamed 5 underscore-prefixed functions in reports.py to public names since they're used cross-module by mcp_server.py — aligns naming with actual shared API contract

Test plan

  • All 14 tests pass
  • All module imports verified
  • _decode_bytes remains 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_RETRIES to a minimum of 0, avoiding negative retry counts that could skip API attempts.

Promotes previously underscore-prefixed helpers in reports.py to public shared helpers (fetch_all_messages, fetch_all_message_ids, parse_headers, parse_body, format_date) and updates mcp_server.py and 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.

- 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>
@AdamFerguson06 AdamFerguson06 self-assigned this Feb 17, 2026
@AdamFerguson06 AdamFerguson06 merged commit fe9a086 into main Feb 17, 2026
4 checks passed
@AdamFerguson06 AdamFerguson06 deleted the fix/bugbot-review-fixes branch February 17, 2026 20:20
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