Skip to content

v3.18.7

Choose a tag to compare

@mrbro-bot mrbro-bot released this 18 Sep 09:09
· 122 commits to main since this release
3019c96

What's new

This patch closes the diagnostic half of systematic config show — a broken config now explains itself, and reports failure the way a script expects.

Bug Fixes

config show now tells you why a config failed to load. The prose renderer printed Resolved configuration: unavailable (the configuration failed to load). and stopped — no file, no key, no reason — because a bare catch in printResolvedSection discarded the Error object. The --json renderer never had that gap: buildConfigShowJson bound the error and returned its message, so identical input produced a useful explanation in one rendering and a dead end in the other. Nothing in the code or docs suggested the prose form was meant to be less informative; the two catches were simply written differently. The failure report now carries a Reason: line with the same message --json returns, naming the offending file and key (#995, 555595a).

This deliberately does not relax the rejection itself. A project-level agents.*.model or categories.*.model overlay is still refused by design as a trust boundary; the change only ensures that if the failure is meant to be hard, it at least says why.

The same failure now produces a non-zero exit and lands on stderr. After the diagnostic fix, the two renderings agreed on the reason and disagreed on everything else: config show exited 0 on a broken config while config show --json exited 1, and the earlier test had pinned that 0 rather than flagging it. A script or agent invoking the default form read success from a config that had not loaded. printResolvedSection now reports whether the load succeeded and configShow exits 1 when it did not. The report also moves from stdout to stderr in full, so config show 2>err.log no longer yields an empty error log beside a non-zero exit — splitting a two-line report across streams would leave either half unreadable on its own. The --json envelope stays on stdout on purpose: that document is the machine-readable output, error field included, and consumers still pipe it to jq (#997, 3019c96).

Both changes were verified across rejected, valid, and absent project configs to confirm the healthy paths still exit 0. The regression tests pin the two renderings to each other — matching exit codes and matching reason strings against the same broken config — so a future divergence fails regardless of which side moves. Exit codes are now stated in the model-profiles guide, which previously described what config show prints but not what it returns.

Also in this release

  • deps: Update OpenCode to v1.18.31 (#994, 35daceb).
  • deps: Update dependency typebox to v1.3.31 (#996, 4edb4af).

Compare

v3.18.6...v3.18.7