Skip to content

Commit 4990a56

Browse files
committed
fix(core): add deepseek-r1 to output token limit patterns
deepseek-r1 normalizes to `deepseek-r1` which does not match the existing `^deepseek-reasoner` output pattern, causing it to fall through to the 8K default. DeepSeek R1 supports 64K output tokens, same as deepseek-reasoner. Without this fix, responses from deepseek-r1 are silently truncated at 8K tokens. Made-with: Cursor
1 parent f1ee463 commit 4990a56

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

packages/core/src/core/tokenLimits.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,8 @@ describe('tokenLimit with output type', () => {
284284
describe('other output limits', () => {
285285
it('should return correct output limits for DeepSeek', () => {
286286
expect(tokenLimit('deepseek-reasoner', 'output')).toBe(65536);
287+
expect(tokenLimit('deepseek-r1', 'output')).toBe(65536);
288+
expect(tokenLimit('deepseek-r1-0528', 'output')).toBe(65536);
287289
expect(tokenLimit('deepseek-chat', 'output')).toBe(8192);
288290
});
289291

packages/core/src/core/tokenLimits.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ const OUTPUT_PATTERNS: Array<[RegExp, TokenCount]> = [
169169

170170
// DeepSeek
171171
[/^deepseek-reasoner/, LIMITS['64k']],
172+
[/^deepseek-r1/, LIMITS['64k']],
172173
[/^deepseek-chat/, LIMITS['8k']],
173174

174175
// Zhipu GLM

0 commit comments

Comments
 (0)