Using Repowise to Contribute to Repowise
In my last post I tried Repowise on a small repo and pulled embeddinggemma into Ollama for semantic search. That turned up a bug: repowise init listed embeddinggemma as a generation model, and could even pick it as the default. An embedding model can’t write pages, so I filed #6529 and opened #6533 to fix it.
All the tests passed. Then the Repowise bot reviewed the PR:
⚠️ Health of changed files: 7.6 → 7.2 (-0.4; structure -0.3)
I had written a fix for a code-health tool without running the code-health tool on it. I’d never indexed Repowise itself.
Index Repowise for Repowise
Same command as last time, in my Repowise checkout:
repowise init --yes --no-prose
One catch: Claude Code had already started the Repowise MCP server in that session, and that server had decided there was no index. Every Repowise tool kept saying “This repository has no repowise index yet” even after init finished. Reconnecting the server with /mcp fixed it. If you index a repo partway through a session, reconnect.
Reproduce the bot’s number locally
The bot compares the changed files at the PR’s base and head. repowise health --score does the same thing on your machine, with --against naming the base commit:
repowise health \
--score packages/core/src/repowise/core/providers/llm/ollama.py \
--score tests/unit/test_providers/test_ollama_provider.py \
--against a83e69f4a
File At a83e69f4a Now Change Structure
.../providers/llm/ollama.py 8.44 7.90 -0.54 2.10
tests/.../test_ollama_provider.py 10.00 10.00 +0.00 0.00
Average (weighted by nloc): 9.03 -> 8.69 (-0.34; structure deduction +0.33)
My numbers aren’t the bot’s (8.44 → 7.90 here, 7.6 → 7.2 on the PR). I ran this in a worktree with no index of its own, so it scored only the code’s shape. The bot also counts git history. It’s the same drop, though, and all of it is in ollama.py’s structure.
Find the cause
repowise health check is the gate built for CI. It analyzes the changed files at both revisions and lists the findings the change introduced:
repowise health check a83e69f4a..HEAD
warning ollama.py:164 _read_model_facts has 10 independent paths (cyclomatic complexity) (introduced, medium)
note ollama.py:119 a network call is reached once per loop iteration through
_ollama_model_options -> _generates_text -> _read_model_facts
(cross-function I/O call inside a loop) (introduced, medium)
The warning is the score drop. My fix added the "completion" capability next to the existing "thinking" check in _read_model_facts, and each new check added another path through the function:
capabilities = data.get("capabilities")
if not isinstance(capabilities, list):
capabilities = None
return _ModelFacts(
trained,
_modelfile_num_ctx(str(data.get("parameters") or "")),
"thinking" in (capabilities or ()),
"completion" in capabilities if capabilities else None,
)
The fix
I moved the capability parsing into its own small function, so _read_model_facts goes back to the shape it had before my change:
thinks, generates = _capability_facts(data.get("capabilities"))
return _ModelFacts(
trained,
_modelfile_num_ctx(str(data.get("parameters") or "")),
thinks,
generates,
)
def _capability_facts(capabilities: object) -> tuple[bool, bool | None]:
"""``(thinks, generates)`` from /api/show's ``capabilities`` list.
``generates`` is None when the server reports no capabilities, so the
caller can fall back to the model's name.
"""
if not isinstance(capabilities, list) or not capabilities:
return False, None
return "thinking" in capabilities, "completion" in capabilities
The behavior is the same, and the 34 provider tests still pass. Running the same score command again:
.../providers/llm/ollama.py 8.44 8.44 +0.00 1.56
Average (weighted by nloc): 9.03 -> 9.03 (+0.00; structure deduction +0.00)
And the gate:
note ollama.py:119 a network call is reached once per loop iteration ...
Gate passed
After I pushed the new commit, the bot reviewed the PR again and agreed: “Health of changed files: 7.6 (unchanged)”, and “Reviewed the whole diff: nothing to fix.”
The note I kept
The remaining note is real: listing models now calls Ollama’s /api/show once per pulled model. Ollama’s /api/tags, which lists the models, doesn’t say which ones can generate text, so asking each model is how you find out. A note doesn’t count against the score, and I’d rather explain the cost in the PR than hide it.
The bot’s AI review also found a real problem that has nothing to do with the score. If /api/show fails briefly, the code can’t tell “the server didn’t answer” apart from “the server reported no capabilities”, so it falls back to guessing from the model’s name. An embedding model without “embed” in its name, like bge-m3 or nomic-bert, would show up in the list again.
I left that one as it is, on purpose, and said so on the review thread. A failure keeps the model in the list, which is the same list everyone got before my fix, and it never hides a model that can generate text. It’s also unlikely: /api/show runs right after /api/tags has answered, against the same server, and that server is usually Ollama on localhost. I thought about a retry, but a local server that just failed or timed out will probably do it again. The calls run one model at a time with a 5-second timeout, so on a hung server a retry would double the wait. It would also add paths back to the function I’d just simplified.
What I’ll do differently
Repowise tells agents how to use it. Its MCP instructions say to call get_risk before editing a widely imported file and get_change_risk before committing. None of that helps if the repo was never indexed. So for any repo I’m contributing to, Repowise included:
repowise init --yes --no-prose # once, then /mcp in Claude Code
repowise health check origin/main...HEAD # before pushing
repowise health --score <changed files> --against <base> # when you want the number
health check makes no LLM calls and needs no index, so it’s cheap to run before every push. It would have caught this before the bot did.
Claude Code and Opus 5.5 were instrumental in fixing the bug, running Repowise on its own code, making the refactor, and drafting this blog post.
Copyright 2026 Wendy Smoak - This post first appeared on wsmoak.net and is CC BY-NC licensed.

