This repository was archived by the owner on Oct 20, 2026. It is now read-only.
Repository navigation
feat: make CodeGuard provider-agnostic + fix review crash - #1
Merged
Merged
Conversation
Introduce generic LLMConfig + LLMClient supporting any OpenAI-compatible endpoint (OpenAI, OpenRouter, Ollama, MiMo, llama.cpp) with bearer or api-key auth. MiMoConfig/MiMoClient kept as backward-compat aliases. Default temperature stays 0.3 for code-review accuracy. 27 tests pass.
Cover provider presets (openai/openrouter/ollama/mimo), bearer vs api-key auth, env resolution, low code-review temperature, and MiMo backward-compat paths. 44 tests pass.
Reposition from 'MiMo-exclusive' to 'any OpenAI-compatible LLM'. Add Supported Providers table + Configuration section, update README header/badges/diagram, CLI help text, pyproject metadata, and package docstring. MiMo now listed as one provider among many.
The 'review' command called _detect_language() which was never defined, crashing single-file reviews with NameError. Add the helper with an extension->language map (+5 tests). Apply ruff format repo-wide so the format gate passes. 49 tests green, ruff clean.
Add .github/workflows/ci.yml (ruff lint + format check + pytest with coverage across Python 3.10/3.11/3.12), contributor guide, and bug/ feature issue templates with a chooser config.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What
Makes CodeGuard provider-agnostic — it now runs on any OpenAI-compatible
/chat/completionsendpoint instead of being locked to one backend. Also fixes a crash in thereviewcommand.Why
The pipeline already spoke the standard OpenAI protocol internally; only the config/client names and auth header were hardcoded. This change exposes that flexibility so users can run on OpenAI, OpenRouter, Ollama, llama.cpp, or Xiaomi MiMo with a single config line.
Changes
core/config.py— new genericLLMConfigwithPROVIDER_PRESETS(openai/openrouter/ollama/mimo), bearer vs api-key auth styles, env-var resolution.MiMoConfigkept as a backward-compat subclass;CodeGuardConfig.mimoaliases.llmand legacymimo:YAML blocks still load. Default temperature stays 0.3 for code-review accuracy.core/llm_client.py—LLMClient(renamed fromMiMoClient, now provider-agnostic).core/mimo_client.pyis a thin re-export shim;MiMoClientremains an importable alias.cli.pybug fix — thereviewcommand called_detect_language(), which was never defined, crashing single-file reviews withNameError. Added the helper with an extension→language map..github/workflows/ci.yml: ruff lint + format check + pytest with coverage on Python 3.10/3.11/3.12.CONTRIBUTING.mdand issue templates.ruff formatrepo-wide.Backward compatibility
No breaking changes. Existing
MIMO_API_KEY/MiMoConfig/MiMoClient/mimo:config usage all continue to work.Verification