Repository navigation
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
anujbolewar
left a comment
There was a problem hiding this comment.
nice, inlining the root ref is way cleaner than leaving a dangling top-level $ref for tools that don't resolve it. small q: if the root ref points at a non-object def (like an array or enum) it silently falls through to the old behavior — just curious if that's intentional or if a root array config is even possible.
|
Thanks! Yes, that fallback is intentional. The generated config schema root is expected to be an object today, so the useful compatibility fix is to inline the resolved object root and expose |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #41014
Type of change
What does this PR do?
Makes the generated public config schema expose its root object schema directly instead of publishing a bare top-level
$ref. The generated schema keeps$defsfor nested references, but the top level now hastype/propertiesso standard JSON language servers can apply completions and validation.It also avoids emitting the non-standard top-level
allowCommentsandallowTrailingCommaskeys in the generated schema output.How did you verify your code works?
bun test ./test/script/schema.test.ts --test-name-pattern 'generated config schema exposes root properties'bun typecheckinpackages/opencodebun run lint packages/opencode/script/schema.ts packages/opencode/test/script/schema.test.tsgit diff --checkNote: repo-wide pre-push typecheck is currently blocked by an existing
@opencode-ai/enterprise/src/custom-elements.d.tsparse error unrelated to this diff, so I pushed with--no-verifyafter the focused checks passed.Screenshots / recordings
Not a UI change.
Checklist