Repository navigation
fix(provider): preserve DeepSeek V4 output limit - #38232
punkisnotdead3 wants to merge 5 commits into
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. |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
Hi maintainers — I synced this PR with the latest
Could a maintainer please approve the pending |
# Conflicts: # packages/opencode/test/provider/transform.test.ts
|
Synced again with current Validation:
The PR is mergeable again. The pending One unrelated Vertex Anthropic |
PR anomalyco#38232 (anomalyco#38232) adds isDeepSeekV4 which calls model.api.id.toLowerCase() unguarded. The fork's session/compaction tests build Provider.Model instances with no api.id, and overflow.ts calls maxOutputTokens without an explicit cap, so the unguarded access throws. Guard the field so non-DeepSeek models with no api.id still flow through.
|
This branch has been upgraded to V2. We're no longer taking PRs for V1. If you think this is still relevant, please port it over and open it for V2. — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊 |
Issue for this PR
Closes #38236
Type of change
What does this PR do?
The global 32K default in
ProviderTransform.maxOutputTokens()overrides DeepSeek V4's declared 384K/393,216-token output limit.This keeps the existing 32K default for other model families, but lets DeepSeek V4 use its positive model-declared output limit when no runtime override is configured. An explicit
OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAXremains authoritative.How did you verify your code works?
bun test test/provider/transform.test.ts— 363 passedbun typecheckbun run lint packages/opencode/src/provider/transform.ts packages/opencode/test/provider/transform.test.ts— 0 errorsbunx prettier --check packages/opencode/src/provider/transform.ts packages/opencode/test/provider/transform.test.tsScreenshots / recordings
N/A — no UI changes.
Checklist