Repository navigation
fix(core): preserve partial model limits - #53129
Sinfony8838 wants to merge 4 commits into
Conversation
Preserve omitted context and output values during legacy model configuration migration.
Keep finite-number validation while allowing context and output limits to be omitted independently.
Cover context-only, output-only, input-only, empty, combined and complete limits, including malformed numeric values.
Verify partial legacy limits match native configuration and only override explicitly configured catalog fields.
|
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. |
|
The following comment was made by an LLM, it may be inaccurate: |
|
Independent confirmation this is the real-world failure mode, from a config that hit it before I found this PR: five models across two providers set only So this is not schema tidiness: without it a provider either loads or silently vanishes depending on one model's limit shape. Thanks for the broader test matrix — context-only, input-only and empty limits all fail the same way, which my narrower attempt had not covered. |
|
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 #53005
Type of change
What does this PR do?
Allows individual legacy model-limit fields and keeps omitted fields unset during migration. Partial overrides no longer discard the provider, and unspecified limits retain catalog defaults. Invalid and non-finite values still produce diagnostics.
Related: #32320 addressed the older
devschema and was closed without merging. This fix targets thev2legacy-config normalization and migration path.How did you verify your code works?
From
packages/core:bun run test test/config/normalization.test.ts test/config/provider.test.ts: 75 passed. The new regressions produced 12 failures before the fix.bun run test test/config: 231 passed, 1 skipped.bun typecheck: passed.Changed-file lint, Prettier and whitespace checks passed. Root
bun run checkcompleted lint/docs checks, then failed on missing console-app dependencies in the filtered local install. The full project test suite was not run.Screenshots / recordings
Not applicable; configuration logic only.
Checklist