v0.3.6 — Discover .reviewbridge.json beyond cwd
What's new
Fixes a real-world failure mode where the bridge MCP server, launched by an MCP host (e.g. Claude Code) from a consumer project's working directory, never found its own .reviewbridge.json and silently fell back to the built-in default model. On ChatGPT-tier Codex installs that hadn't yet rolled out the default, every review call surfaced as MODEL_ERROR.
Discovery cascade
loadConfig now operates in two modes:
- Explicit (
--config <dir>on the CLI): looks only at<dir>/.reviewbridge.json— preserves existing behavior. - Implicit (no arg, e.g. MCP server startup): cascades through
RB_CONFIG_PATHenv var (exact path; missing/unreadable is fatal)- Walk-up from
process.cwd()to a.gitboundary or filesystem root $HOME/.reviewbridge.json- Built-in defaults
First match wins. A startup line on stderr ([codex-bridge] config source: project (/repo/.reviewbridge.json)) names the resolved source.
The CLI's --config flag still bypasses the cascade entirely and looks only at the supplied directory.
Behavior change worth noting
Previously, loadConfig errors were logged and silently swallowed in favor of built-in defaults. They now abort startup. ENOENT during cascade probing is silent (skip to next step), but any .reviewbridge.json that's found must parse cleanly — a malformed file aborts startup with the path in the error rather than running on defaults you didn't ask for. This is the very class of bug T-012 is fixing.
For users hitting the original story-maker case
After upgrading, you have three ways to ensure the bridge picks up your preferred model regardless of which directory the MCP host launches it from:
- Set
RB_CONFIG_PATHin your shell env to the exact.reviewbridge.jsonpath. - Drop
~/.reviewbridge.jsonwith{\"model\": \"gpt-5.4\"}for a per-machine default. - Add a
.reviewbridge.jsonto each consumer project's root.
Install
claude mcp add codex-bridge -- npx -y codex-claude-bridge@latest
The @latest pin makes npx re-resolve on every launch.
Internals
- New
LoadedConfig { config, source }return shape fromloadConfig. server.tsandcli/commands.tsderive copilot-instructions root from the project source path when applicable.mcp.tswrapscreateServer()to print a clean startup-error line and exit cleanly (no stack-trace double-print).- 16 new tests; 508 total passing.
T-012.