Skip to content

[#maintenance] v0.2.0: OpenAI-compatible API, local-LLM accuracy fixes and CLI upgrade - #2

Merged
AfonsoNeto merged 31 commits into
masterfrom
maintenance
Sep 27, 2026
Merged

AfonsoNeto merged 31 commits into
masterfrom
maintenance

Conversation

@AfonsoNeto

Copy link
Copy Markdown
Owner

Summary

Brings the gem to v0.2.0 with a focus on making the local-LLM integration accurate and reliable.

API layer

  • Switch from Ollama's proprietary /api/generate to the standard OpenAI-compatible /v1/chat/completions endpoint — now genuinely works with Ollama, LM Studio, llama.cpp llama-server and vLLM
  • URL normalization: accepts base URLs with or without /v1 and trailing slashes
  • Enforce TLS with certificate verification for https endpoints
  • HTTP timeouts (5s open / 120s read), HTTP status checks and typed errors (ConnectionError, ApiError) with friendly messages
  • Strip ANSI escape sequences from model output (prevents terminal escape injection via prompt-injected diffs)
  • 2048-token budget so thinking models (qwen3) finish reasoning before answering; inline <think> blocks stripped
  • Output cleaning: code fences, quotes and multi-suggestion replies reduced to a single 72-char subject line

CLI

  • commit now commits by default after a y/n confirmation (closed stdin counts as "no" so non-interactive runs never auto-commit)
  • New --message-only flag replaces print-only behavior; --conventional for Conventional Commits format; --length for subject length
  • New models command lists models from the server; config picks from that list when reachable
  • Fixed options.length collision that truncated every generated message to 3-4 characters
  • Fixed option resolution where explicitly passed --url/--model were ignored
  • Skip the LLM call when nothing is staged; cap diff size at 12k chars; handle detached HEAD

Housekeeping

  • Default model → qwen3:8b
  • Minitest suite (23 tests) with a dependency-free mock HTTP server
  • GitHub Actions CI (Ruby 3.1–3.4) with tests and bundler-audit dependency scanning
  • MIT license, gemspec cleanup, README rewrite with a terminal demo GIF (regenerable via docs/generate_demo.py)

Test plan

  • bundle exec rake test — 23 tests, all green (verified repeatedly, plus on CI across Ruby 3.1–3.4)
  • Live end-to-end runs against local Ollama (qwen3:8b and qwen2.5-coder:7b): generation, confirmation flow, EOF handling and --message-only

@AfonsoNeto
AfonsoNeto merged commit 5b65e39 into master Sep 27, 2026
8 checks 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