Repository navigation
docs(www): say unknown cli.json settings and keybind IDs are ignored - #57125
Open
HaseebUllahButt wants to merge 1 commit into
Open
HaseebUllahButt wants to merge 1 commit into
HaseebUllahButt wants to merge 1 commit into
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
Contributor
There was a problem hiding this comment.
The new wording is accurate. I ran the actual cli.json decoder (Schema.decodeUnknownOption(Info)) against sample configs:
- An unknown top-level setting is dropped quietly, and the other settings are kept.
- An unknown keybind ID is dropped too. Decoding doesn't fail, so the
Unrecognized keybinderror inparse()is never hit. - Setting a known command to
truemakes the decode fail, so the whole file falls back to defaults. On an unknown ID it is simply dropped, which matches your "known command" wording. - The published
$schemais generated withonExcessProperty: "error", so editors do flag unknown settings.
Public API: unchanged (docs only).
No concerns. If #56335 lands, the true sentence still holds; OpenCode would just warn instead of failing silently.
Related: #56318
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
This was referenced Oct 23, 2026
This branch has not been deployed
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.
Issue for this PR
None. Docs-only change, no linked issue required.
Type of change
What does this PR do?
cli/config.mdxsays unknown settings are rejected, andcli/keybinds.mdxsays unknown command IDs are rejected. At runtime both are dropped silently, so a typo incli.jsonhas no effect and no message. This PR says so, and notes that the published$schemastill flags unknown settings in editors.The keybinds page also notes that
trueis not a valid binding value: on a known command it makes the wholecli.jsondecode fail, so OpenCode ignores the file.How did you verify your code works?
Read the source at
dev:packages/cli/src/config/config.ts:22decodes withSchema.decodeUnknownOption(Info), which drops excess keys. Only the generated editor schema rejects them (packages/cli/script/schema.ts:8,onExcessProperty: "error").KeybindOverrides(packages/tui/src/config/keybind.ts:306-313) is a struct of the known command names, so an unknown ID is dropped during decode and never reaches theUnrecognized keybindthrow inparse()(keybind.ts:339-341).BindingValueSchema(keybind.ts:28-33) acceptsfalse,"none", strings, key objects and arrays, but nottrue.Docs-only change. I checked both statements against the source paths above, and the edited Markdown keeps valid fences and line wrapping. No application code was run.
Screenshots / recordings
Not a UI change.
Checklist
Added by the opencode bot (AI-generated).
Related: #56318