mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #5189] [Engine] opt in to answer room for short thinking replies #5338
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#5338
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?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/5189
Author: @midhatn
Created: 11/4/2026
Status: 🔄 Open
Base:
main← Head:fix/ws1-short-answer-room-20261104📝 Commits (1)
e48f9c4[Engine] allow answer room for short thinking replies📊 Changes
3 files changed (+64 additions, -5 deletions)
View changed files
📝
docs/DETAILS.md(+1 -0)📝
serve/server.py(+6 -5)📝
serve/test_server.py(+57 -0)📄 Description
Problem and result
With thinking enabled, a Qwen request with a small output limit can spend the entire limit in reasoning and return an empty visible answer. On a dual-V100 Ubuntu host using Qwen3.8-Flash-Next Unsloth UD-Q4_K_XL, two 64-token and two 180-token requests all ended this way.
This adds an opt-in config setting,
short_answer_room: true, that extends the existing short-cap wrap-up to other families. It is off by default. Whenanswer_roomis enabled, thinking is on, no positive thinking budget applies, and the output cap is 48–1,023 tokens, the server reserves half the cap for the wrap-up and answer. DeepSeek-V4.1's existing behavior is unchanged.answer_room: falsedisables the new guard; an explicit positive budget still takes precedence.Related: #5039. That report discusses several possible fixes; this PR takes an opt-in approach to preserve the current default.
Validation
At
e48f9c4a, Windows 11, Python 3.11, with the mock engine:python -m unittest serve.test_server -q: 362 tests run, 3 skipped, no failures.python -m unittest serve.test_server.ThinkingBudget serve.test_dsv41.SmallCap -q: 30 tests passed.python -m unittest discover -s serve -t . -p 'test_*.py' -q: 1,388 tests run, 30 skipped, no failures. The run emitted a PythonResourceWarningabout an unclosed file; its origin was not investigated.answer_room: false, a cap below the guard's floor, and OpenAI/Anthropic streaming.git diff --checkpassed.On the dual-V100 host, the same synthetic arithmetic prompt was sent twice at each output cap with temperature zero. The retained baseline used the unmodified frontend; the candidate used this server change with
short_answer_room: true, alongside the same retained tool-parser and diagnostic-telemetry frontend changes. The model, engine, context capacity, and 200 W GPU limits were the same.All four visible candidate answers were numerically wrong. The probe demonstrates improved visibility on this one prompt, not an accuracy fix. As controls, the explicit 96-token-budget requests were visible in both trials on each frontend; one baseline answer and no candidate answers were correct. A no-thinking control was also wrong on both. These small samples do not establish an overall accuracy comparison.
Limits and remaining checks
This remains a draft. The wrap-up itself consumes output tokens, so a very small cap may still leave no answer, and ending thinking sooner can change or worsen the answer. More tasks, caps, models, and quality checks are needed before recommending the opt-in. Passing these checks does not establish general answer accuracy or byte-for-byte output parity. No native GPU code is changed, and no performance improvement is claimed.
AI assistance was used for the diagnosis, implementation and tests.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.