fix: fallback custom model output limit to OUTPUT_TOKEN_MAX instead of 0 - #22587
fix: fallback custom model output limit to OUTPUT_TOKEN_MAX instead of 0#22587comzip wants to merge 1 commit into
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Based on the search results, I found two potentially related PRs that might be addressing similar issues:
These PRs appear to be addressing similar token limit validation issues, though they may target different providers or specific cases. You may want to check if they overlap in scope or if they're complementary fixes. |
62f9c7e to
26d3f0b
Compare
|
The |
Custom provider models without a limit field were getting limit.output = 0 (sentinel value), causing downstream errors like 'maxOutputTokens must be >= 1'. Changed the fallback from 0 to ProviderTransform.OUTPUT_TOKEN_MAX (32000), consistent with built-in model behavior. Fixes anomalyco#22253
26d3f0b to
95b26f6
Compare
|
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
Fixes #22253
Type of change
What does this PR do?
Custom provider models without an explicit
limit.outputgetoutput: 0as a sentinel value. This 0 propagates to the API call, causingmaxOutputTokens must be >= 1errors. Changed the fallback from0toProviderTransform.OUTPUT_TOKEN_MAX(32000), consistent with built-in model behavior.How did you verify your code works?
Added a test: custom model without
limit.outputnow getsOUTPUT_TOKEN_MAXinstead of0. Also updated an existing test that was asserting the old (broken) behavior.Screenshots / recordings
N/A
Checklist