Skip to content

fix: chunk-and-summarize execution, gemini-3.5-flash window, and Phase 3/4 checklist discrepancies #8

Closed

Description

@getdownandcode

Problem Description

A comprehensive review of Phases 3 & 4 against the consolidated requirements and review checklist identified several discrepancies, missing deliverables, and bugs:

  1. Missing Chunk-and-Summarize Execution for Large Diffs:
    When TokenBudgetManager.assess() returns BudgetStrategy.NEEDS_CHUNKING, generate_commit_message in src/gitmate/fallback.py previously short-circuited directly to a template-based fallback (is_fallback=True), skipping LLM generation entirely. As specified in plan.md and the Phase 4 review checklist, Phase 4 must consume BudgetDecision.omitted_diffs (which preserves the untruncated original patches), summarize each chunk via active_provider.generate(), merge the summaries into the prompt's summary_note, and generate the final commit message (with graceful degradation if the provider fails).

  2. Missing gemini-3.5-flash in DEFAULT_MODEL_CONTEXT_WINDOWS:
    DEFAULT_MODEL_CONTEXT_WINDOWS in src/gitmate/config.py contained gemini-3.5-flash-lite, gemini-3-flash, and gemini-flash, but omitted gemini-3.5-flash (non-lite) and lacked an explanatory comment clarifying that gemini-3.5-flash-lite remains the configured default. Users setting model = "gemini-3.5-flash" received UnknownModelError.

  3. Missing RetryableError Alias in providers/base.py:
    The transient error marker was named RetryableProviderError, but the review checklist and callers expect RetryableError.

  4. Stale SDK and Provider References in plan.md:
    plan.md retained stale references to AnthropicProvider (Phase 4, line 90) and Anthropic SDK token counting (Phase 2, lines 57 & 63, and design decision table line 15), contradicting the locked-in decision in AGENTS.md specifying Gemini as default.

  5. template_overhead Calibration:
    The 500 token default estimate was evaluated against the actual template files (commit_conventional.txt: ~329 tokens, commit_plain.txt: ~210 tokens, pr_summary.txt: ~206 tokens), confirming 500 tokens provides a safe upper bound with ~170+ tokens of headroom for dynamic notes.

Proposed Resolution

  • Implement _chunk_patch_text and summarize_omitted_diffs in src/gitmate/fallback.py to execute chunk-and-summarize on NEEDS_CHUNKING, merging notes into the final prompt while retaining graceful degradation on provider failure.
  • Add "gemini-3.5-flash": 1_048_576 to DEFAULT_MODEL_CONTEXT_WINDOWS in src/gitmate/config.py with explanatory comments.
  • Export RetryableError = RetryableProviderError in src/gitmate/providers/base.py.
  • Update plan.md to eliminate stale Anthropic SDK references in favor of the Google GenAI SDK and document Phase 4 chunk-and-summarize delivery.
  • Add test coverage across tests/test_orchestrator.py, tests/test_config.py, and tests/test_providers.py.

Activity

  1. added a commit that references this issue on Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions