Repository navigation
Commit 5de9656
committed
fix(core): propagate resolved output limit into model request generation
The prepared model request only carried generation values set by hooks, so a
model's configured limit.output never reached the provider. On Bedrock the
request was sent without inferenceConfig.maxTokens and the service applied a
much lower implicit budget; with adaptive thinking the whole budget could be
consumed by reasoning, truncating responses at exactly 4,096 output tokens
despite limit.output=128000.
Project maxTokens with explicit precedence: hook/context override, model
defaults, route defaults, then resolved.limit.output. Each protocol already
lowers generation.maxTokens into its native field, so no protocol changes are
needed.
Closes anomalyco#46595
Related: anomalyco#473981 parent 437cdc0 commit 5de9656
3 files changed
Lines changed: 39 additions & 3 deletions
File tree
- packages/core
- src/session
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
252 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
253 | 263 | | |
254 | 264 | | |
255 | 265 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
410 | | - | |
| 410 | + | |
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2959 | 2959 | | |
2960 | 2960 | | |
2961 | 2961 | | |
| 2962 | + | |
| 2963 | + | |
| 2964 | + | |
| 2965 | + | |
| 2966 | + | |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
| 2970 | + | |
| 2971 | + | |
| 2972 | + | |
| 2973 | + | |
| 2974 | + | |
| 2975 | + | |
| 2976 | + | |
| 2977 | + | |
| 2978 | + | |
| 2979 | + | |
| 2980 | + | |
| 2981 | + | |
| 2982 | + | |
| 2983 | + | |
| 2984 | + | |
| 2985 | + | |
| 2986 | + | |
| 2987 | + | |
2962 | 2988 | | |
2963 | 2989 | | |
2964 | 2990 | | |
| |||
2973 | 2999 | | |
2974 | 3000 | | |
2975 | 3001 | | |
2976 | | - | |
| 3002 | + | |
2977 | 3003 | | |
2978 | 3004 | | |
2979 | 3005 | | |
| |||
0 commit comments