Repository navigation
fix(config): surface configuration errors in TUI and CLI - #481
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #476.
config.getasdocument.experimental.diagnostics. Rejected files contribute no settings; valid siblings still load.config.updatedrefreshes replace/clear diagnostics after repair or deletion; unchanged errors do not repeatedly toast.debug configalso retains the diagnostics.mcp list,models, anddebug configexit 1 while preserving available output;runonly refuses a whole-file diagnostic (`## SummaryCloses #476.
config.getasdocument.experimental.diagnostics. Rejected files contribute no settings; valid siblings still load.config.updatedrefreshes replace/clear diagnostics after repair or deletion; unchanged errors do not repeatedly toast.debug configalso retains the diagnostics.). Auth, logout, MCP auth/logout, and debug agents warn and continue.
mcp listresult by waiting on the client for initial plugin activation before listing. A timeout, disabled MCP config loader, or failed activation is reported explicitly. Server reads remain nonblocking.Root causes
Config.parseInfologged normalization warnings and discarded rejected files; neither startup clients nor hot-reload subscribers had a diagnostic in their config read model. Schema normalization also discarded the validation explanation.mcp listimmediately read a cold Location's catalog, before the asynchronous config MCP plugin registered its servers. The empty snapshot was indistinguishable from truly unconfigured MCP. The existing config plugin remains the sole server-registration path.Feature flag / API
No feature flag: these are bug fixes. The additive diagnostics metadata is experimental. Client types were regenerated with
bun run generateinpackages/client; no generated files were edited by hand.Verification
bun run check— passes (existing advisory lint warnings remain).git diff --check— passes.Visual
Review fixes
Nine follow-up commits, one per review item:
5adcf28b7a— Warn-and-continue by default; only MCP/model/config listings and whole-file run failures set exit 1. Real standalone tests prove a broken repository.opencode/opencode.jsondoes not blockauth listorauth logout. A valid disabled MCP server is listed even alongside an invalid setting, then the command exits 1.feb05d7532— Exit cleanly after printing configuration errors, without a JavaScript stack trace.f75856dd19— EOF errors identify the innermost unclosed object/array and its opening line, including unclosedmcp.servers.fc84dc7c8c— Parse error code and source offset come from the same error list; omit position when substitution changes the error.a87cda6472— Report disabled MCP configuration loading as soon as the nonempty plugin list proves it absent.705be1a075— Zero-byte and whitespace-only configuration files behave as{}, with no diagnostic/toast.9ec3c07966— Remove empty$:prefixes and use readable permission expectations.7d5290fc36— Test unchanged diagnostics onconfig.updateddo not toast again, and that a skipped setting still permits a successful run. Auth regression coverage is in item 1.9ac8fd1c96— Revert unrelated well-known block formatting.Review-fix verification
bun run check: passed (39 typecheck tasks; advisory lint warnings remain).git diff 9f50f426b0..HEAD --check: passed.test/configplustest/permission.test.ts: 439 passed.test/runsuites: 71 passed.