Skip to content

Release v0.13.6

Reliability & Architecture - Streaming Retry + Amend Hook + Module Restructure

Adds automatic retry for truncated LLM streaming responses, git commit --amend support in the prepare-commit-msg hook, and major internal restructuring of the config and provider modules.

Added

Streaming Response Retry

  • spawn_stream_with_retry() detects truncated streams (no message_stop from Claude, no [DONE] from OpenAI/Gemini) and automatically resends the HTTP request with exponential backoff
  • New StreamChunk::Retry variant clears the UI buffer before retry
  • Retryable conditions: LlmTimeout, LlmConnectionFailed, LlmStreamTruncated, HTTP 429/5xx

Git Commit --amend Hook Support

  • prepare-commit-msg hook now detects amend scenarios via determine_hook_mode()
  • Amend mode generates messages from the original commit's diff; if additional changes are staged, combines both diffs
  • New i18n string: hook.generating_amend

Error Types

  • LlmStreamTruncated: streaming response ended without proper termination
  • LlmContentBlocked: provider safety filter triggered (Gemini SAFETY/RECITATION)
  • LlmTimeout / LlmConnectionFailed: explicit HTTP-level failures
  • All new variants include localized messages and actionable suggestions

Changed

Config Module Split

  • Split monolithic config/structs.rs (685 lines) into 4 focused modules: app.rs, commit.rs, llm.rs, network.rs

Provider Module Restructure

  • Provider implementations moved under provider/backends/
  • SSE stream parsers extracted to provider/streaming/ with per-provider modules (claude.rs, openai.rs, gemini.rs)
  • Base utilities (retry, response, validation) remain under provider/base/

Dependencies

  • Added httpdate 1.0 for Retry-After header parsing
  • Updated clap, reqwest, serde_json and other dependencies

Documentation

  • Clarified custom_prompt behavior: replaces system prompt in normal mode, appended as constraints in split mode; no placeholder substitution
  • Clarified max_diff_size applies only to non-split flows

Tests

  • determine_hook_mode(): all source/SHA combinations (message, merge, squash, commit, amend)
  • Streaming retry: 429 Retry-After handling, 5xx errors, truncation detection
  • Exponential backoff calculation

Upgrade

bash
# Homebrew
brew upgrade gcop-rs

# Cargo
cargo install gcop-rs

# pip
pip install --upgrade gcop-rs