Repository navigation
Commit 4bf5728
authored
fix(dsh): export a known output limit as
DSH treats an exported `maxTokens` as the model's real output ceiling and
sends it as `max_tokens`; when the field is absent it falls back to its own
`DEFAULT_MAX_TOKENS = 32768`. The DSH exporter emitted only `contextWindow`,
so every model outside DSH's bundled catalog silently ran on 32768 even when
the real limit was far larger — long answers were cut off mid-sentence.
The catalog row already carries the authoritative limit (`toExportModel`
maps `maxOutputTokens` to `maxTokens`, and #5828 established that this value
must win over the 32000 schema stand-in). The OMP exporter has consumed it
since that fix; DSH simply never did.
Add `knownOutputBudget()` next to `outputBudgetFor()`. The two differ only in
the unknown case: `outputBudgetFor` must return a number because its callers
cannot express "unknown", while `knownOutputBudget` returns undefined so a
client that has a meaningful default is not handed the 32000 stand-in and
does not claim a limit no model declared. Emitting `outputBudgetFor` here
would have reintroduced exactly the over-reporting #5828 fixed.
DSH now declares `maxTokens` only when the row (or the bundled per-model
metadata) knows one, clamped to the exported context window, and stays silent
otherwise — including when no context window is exported at all.
Verified on a real install (opencodex 2.92.0):
- exported entries carrying `maxTokens`: 0 -> 30 of 40
- entries that lost a `maxTokens` they previously declared: 0
- `contextWindow` values changed: 0
- `bun test tests/config/`: 733 pass, 0 fail
- `tsc --noEmit`: clean
The existing DSH test asserted `not.toHaveProperty("maxTokens")` on every
row. That assertion predates #5828 and was never revisited when the other
exporters started carrying the field, so it pinned the omission rather than a
decision. It stays for rows with no known limit and gains a positive case.maxTokens (#7763)1 parent 96f2f47 commit 4bf5728
3 files changed
Lines changed: 34 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
29 | 34 | | |
30 | 35 | | |
31 | 36 | | |
| |||
97 | 102 | | |
98 | 103 | | |
99 | 104 | | |
| 105 | + | |
100 | 106 | | |
101 | 107 | | |
102 | 108 | | |
103 | 109 | | |
104 | 110 | | |
105 | 111 | | |
| 112 | + | |
106 | 113 | | |
107 | 114 | | |
108 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
34 | 53 | | |
35 | 54 | | |
36 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
544 | 544 | | |
545 | 545 | | |
546 | 546 | | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
547 | 550 | | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
548 | 555 | | |
549 | 556 | | |
550 | 557 | | |
| |||
0 commit comments