Skip to content

v0.3.6 — Discover .reviewbridge.json beyond cwd

Choose a tag to compare

@AmirShayegh AmirShayegh released this 26 Apr 08:50

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
    1. RB_CONFIG_PATH env var (exact path; missing/unreadable is fatal)
    2. Walk-up from process.cwd() to a .git boundary or filesystem root
    3. $HOME/.reviewbridge.json
    4. 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:

  1. Set RB_CONFIG_PATH in your shell env to the exact .reviewbridge.json path.
  2. Drop ~/.reviewbridge.json with {\"model\": \"gpt-5.4\"} for a per-machine default.
  3. Add a .reviewbridge.json to 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 from loadConfig.
  • server.ts and cli/commands.ts derive copilot-instructions root from the project source path when applicable.
  • mcp.ts wraps createServer() to print a clean startup-error line and exit cleanly (no stack-trace double-print).
  • 16 new tests; 508 total passing.

T-012.