Repository navigation
This patch release adds support for OpenCode's claude-agent provider, so reviews can run on a Claude subscription. DiffLoupe now reads OpenCode's whole config chain to find the default model, and native Windows is supported on a best-effort basis.
Changelog
Reviewing with a Claude Subscription (claude-agent)
OpenCode 2.3 includes a claude-agent provider that runs models through Claude Code with your Anthropic subscription login. DiffLoupe can now use it for any stage:
diffloupe review --model review=claude-agent/opus --model coordinator=claude-agent/opusThis needs Claude Code's claude CLI on PATH or in OPENCODE_CLAUDE_PATH, version 2.1.248 or newer, plus a Claude login connected in OpenCode with /connect. DiffLoupe copies that login into each reviewer run. The login has no secret in it, so this works the same way as API keys.
OpenCode keeps Claude Code's model list only in its local database and fetches it in the background. A fresh reviewer run didn't have the list yet, so opencode run failed with Model unavailable. DiffLoupe now copies the saved model list into each reviewer run and checks model names and effort levels against it before the run starts. If OpenCode has never listed Claude Code's models, the review stops and tells you to open OpenCode and pick a claude-agent model once.
Subscription runs report no cost, so they show as $0. --max-cost can't count their spend. The run log and diffloupe doctor now say so plainly: either the limit isn't enforced, or it covers only the stages that report a cost. Models that report an empty cost list now count as unpriced too. Before this, only models that reported a price of zero did.
OpenCode's Default Model Comes From All of OpenCode's Config Files
DiffLoupe used to read only the global OpenCode config (~/.config/opencode/opencode.json) when looking for a default model. It now reads the same files OpenCode does, in the same order. That order is the global config, OPENCODE_CONFIG, project opencode.json files from the reviewed repo up to the filesystem root, .opencode/ folders, OPENCODE_CONFIG_CONTENT, and finally the system config (C:\ProgramData\opencode on Windows, /Library/Application Support/opencode on macOS, /etc/opencode elsewhere). The system config also applies inside reviewer runs, so the model DiffLoupe picks now matches what OpenCode uses.
If the default model's provider can't be used, the review now stops with an error. The error names the file the model came from and how to choose another one: --model <stage>=<provider/model>, models.<stage> in DiffLoupe's settings, or opencode.useDefaultModel: false. DiffLoupe does not quietly fall back to its built-in Anthropic models.
Custom providers are read from every file except project files and .opencode/ folders. Those files come from the checkout under review, so a pull request could otherwise point a provider at its own server and receive the diff and your API key. Reviewer runs also ignore OPENCODE_DB, so they never write to your own OpenCode database.
Clearer Credential Errors and doctor Output
When you have an OpenCode login for a provider that isn't an API key, such as an OAuth login, the error no longer tells you to run opencode auth login. That command can't help in this case. The error now says DiffLoupe can only copy API keys and lists the ways to provide one.
diffloupe doctor now shows:
- which OpenCode config files it found, and where each stage's model came from
- the Claude Code login and
claudeversion when a stage usesclaude-agent - errors from the saved
claude-agentmodel list - which stages report no cost
Native Windows Support (Best Effort)
DiffLoupe now runs on native Windows, not just WSL. On Windows:
- Agents run with hidden windows. Before, every console tool an agent started opened a new window.
- Cancelling a review kills the agent and its tilth servers with
taskkill /T /F. - OpenCode is started by name, because spawning its
.cmdshim by full path fails on Windows.
doctor now warns on Windows instead of failing. One known gap: programs an agent starts through Git Bash can keep running after a cancel until they finish. WSL is still the better-tested setup.
What's Changed
- Windows support by @markerikson in #8
- Build tilth from crates.io in CI by @markerikson in #9
- Support OpenCode's claude-agent provider by @markerikson in #10
Full Changelog: v0.5.0...v0.5.1