Local agent-CLI ReviewLlm impl. Drives one of claude / codex /
gemini / opencode through gate4agent and collects the streamed
assistant text. Used when no HTTP provider is active.
Production ReviewLlm impl that dispatches to the Anthropic native
Messages API when the provider base URL points at api.anthropic.com,
and falls through to the OpenAI-compatible chat/completions path
otherwise.
System prompt split into a cacheable stable prefix and a per-review
dynamic suffix. The stable prefix is intended to be reused across
multiple reviews from the same team (identical perspective + rules +
repo context) so providers that support prompt caching (e.g. Anthropic
cache_control: ephemeral) can skip re-tokenising it.
A single team rule in the canonical form used when producing the
cacheable team-rules digest. This is deliberately minimal: the point
of the digest is to be deterministic / hash-stable across reviews so
that an upstream Anthropic cache_control hint can reuse the prefix.
How run_review talks to the LLM: remote HTTP provider when one is
configured, else a local agent CLI driven through gate4agent (Claude
Code, Codex, Gemini, or OpenCode — whichever is installed). Resolved
once per review by resolve_review_engine.
Sentinel scheme used to route a provider through a local agent CLI
(Claude Code, Codex, Gemini, OpenCode) via gate4agent instead of
any HTTP endpoint. The tool name follows the scheme:
agent-cli://claude, agent-cli://codex, agent-cli://gemini,
agent-cli://opencode. No real URL ever uses this scheme so
collision with a legitimate HTTP provider is impossible.
Thin seam around call_ai_provider used by verify_pass and
run_review_summary so tests can inject canned responses without
spinning up a real HTTP client.