mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #984] reasoning_budget_tokens is ignored? #434
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#434
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @PentaForgeDev on GitHub (Oct 5, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/984
Heyo. Just downloaded, so v0.1.39. Ran the setup.sh on uBuntu 26, all good.
[strata] logging output shows 'thinking: x of max 6400 tokens'. I set
"reasoning_budget_tokens": 2048in the config, but it still thinks up to 6400 tokens, rather than 2048 as set in the config:Interestingly, the logging also shows
answering: x of max 6400 tokens, so im not sure where the 6400 is coming from?Right now, the model just fills itself up thinking then fails to answer.
@talisp commented on GitHub (Oct 5, 2026):
Some data from another 0.1.39 install, and then my opinion on what is happening in your case.
What I checked (0.1.39, Linux)
python -m unittest serve.test_server.ThinkingBudget: 9/9 OK. That includestest_the_config_default_and_a_request_that_turns_it_off, which covers the config'sreasoning_budget_tokens."reasoning_budget_tokens": 64andmax_tokens: 3000to a running server. The log showed: The model then answered normally (finish_reason: stop)."reasoning_budget_tokens": 16000instrata-*.json. The start log prints: On 0.1.38 the same config cut real agent replies twice (thinking budget reached (16000 tokens)).max_tokens({generated} of max {max_tokens}inserve/server.py). It comes from your client or the chat's "max" setting.My opinion (not verified on your machine)
Your symptom, thinking until the limit with no answer, looks like the budget is not active for those requests. The log then says "the reply reached max tokens while still thinking, so it has no answer". The mechanism itself works, so I would check, in this order:
[strata] thinking budget: 2048 tokens …in the window. If it is not there, the budget is not loaded.--config strata-<model>.json.reasoning_budget_tokens. A request's value overrides the config, and0turns the budget off.max_tokenswell above the budget, so there is room left to answer.@talisp commented on GitHub (Oct 5, 2026):
One more idea to isolate it quickly: try the same prompt in Strata's own web chat (open
http://127.0.0.1:11433/in a browser; your port is 11433).The web chat never sends
reasoning_budget_tokens; it sends onlyreasoning_effort, the temperature andmax_tokens(seeserve/web/app.js). So there the config budget is the only one that applies. In the chat settings:Then ask something that makes it think and watch the server window:
[strata] thinking budget reached (2048 tokens): wrapping up the thinkingappears: the server and the config are fine. The problem is in your agent/client, which most likely sends its ownreasoning_budget_tokens(or0, which turns the budget off).[strata] thinking budget: 2048 tokensline: the config is not loaded. Check the restart and which--configthe start script uses.The same check without a browser:
(add
-H "Authorization: Bearer <key>"if you set an API key), then look for the same log line.@Niko1221 commented on GitHub (Oct 6, 2026):
The 6400 in the log line is the request's max_tokens, not the budget. Check the start log for '[strata] thinking budget: 2048 tokens (reasoning_budget_tokens ...)' after a restart: the config is read only at start. A request's own
reasoning_budget_tokensoverrides the config, and 0 turns it off, so a client that sends one would explain this. If the start line is there and a request without its own value never cuts at 2048, please post the log: that would be a real bug.@PentaForgeDev commented on GitHub (Oct 7, 2026):
Ahh ok, so the client can override the reasoning_budget from the config. That explains some things :) I would have thought the config would have overridden, so i guess that's good, means it's more configurable on the fly.
I used the curl above and indeed it showed max_tokens in the logs. And indeed on start it does display the configured reasoning_budget.
Thanks for your help guys, i'll run with this now and see how I go.
cheers
@Niko1221 commented on GitHub (Oct 7, 2026):
reasoning_budget_tokens is a different setting from the 6400 in your log, which is max_tokens. If the budget is not the value you set, please send the first lines of the server log.
@Yassim commented on GitHub (Oct 9, 2026):
I think I'm seeing this well.
I'm also seeing as 3 different numbers.
json config
first lines of start up
error/suggestion after a truncated response.
@Niko1221 commented on GitHub (Oct 10, 2026):
Thanks for the logs. The
of max 6400on thethinking:line is the request'smax_tokens, not the budget. We changed that line: while a thinking budget applies it now readsthinking: 120 of budget 2048 (max 6400) tokens, andanswering:goes back toof max Nafter the wrap-up. The config'sreasoning_budget_tokensapplies to every request that does not send its own value (a request's own value wins, and 0 turns it off). In v0.1.42.@Yassim: Your three numbers: 131072 is the budget in your json, 4096 is the request's max_tokens (the client sets it), and 32768 in the Settings line. We found no clamp anywhere: that line prints the value of the config file as read at that start, so the file held 32768 then (or the window is from before your edit; the config is read only at start, so restart after editing). The real problem is the one you hit: a budget (131072) above max_tokens (4096) can never fire, so the reply ended while still thinking. Fixed in v0.1.42: when a budget is at or above what max_tokens leaves room for, the thinking is now closed early enough to leave room to answer (max_tokens minus a reserve of max(512, a quarter of max_tokens)), and the log says
thinking capped at 3072 of max_tokens 4096 to leave room for the answer (budget 131072). A budget well below max_tokens behaves as before. For long thinking, raise max_tokens in the client too.@Yassim commented on GitHub (Oct 11, 2026):
@Niko1221 Yep, Ive just found the param to fix. It was in my Pi agents config. It was seniding a
max_tokensof the 4k, which ment it kept running out of room when doing some refactoring.BTW, Thanks for this project!
@shizhx commented on GitHub (Oct 13, 2026):
pi coding agent just changed their json schema for models.json and limit the
thinkingTokenBudgetFieldto one ofthinking_token_budget,thinking_budgetorthinking_budget_tokens, maybe we should change field name to follow it.@Niko1221 commented on GitHub (Oct 13, 2026):
Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.
If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.