unsloth/studio
Daniel Han 620b152210 Fix reasoning-only BUFFERING, pre-tool content emission, and code duplication
Addresses review feedback on the streaming tool detection:

1. Reasoning tokens are no longer yielded during BUFFERING/DRAINING
   states. The consumer in routes/inference.py tracks prev_text across
   tool iterations without resetting it, so yielding reasoning during
   a detection pass that resolves to a tool call would corrupt the
   delta computation for subsequent iterations. Reasoning is now
   silently accumulated during detection (matching the old non-streaming
   behavior) and flushed together with content when the buffer resolves
   to STREAMING.

2. Handle reasoning-only responses in the BUFFERING resolver. When a
   thinking model emits only reasoning_content with no content tokens,
   the stream ends while still in BUFFERING state. The resolver now
   detects this case and yields reasoning as plain text (without
   <think> wrapper), matching the final streaming pass behavior for
   models like Qwen3 in always-think mode.

3. Replace duplicated re.sub calls for stripping tool markup with
   the existing _strip_tool_markup(content_text, final=True) helper,
   removing ~40 lines of redundant regex code.

4. Update tests: adjust reasoning test expectations to match the new
   behavior (reasoning batched with content, not streamed individually
   during BUFFERING). Add test_reasoning_only_no_content for the
   reasoning-only edge case. 17/17 tests pass.
2026-03-27 06:45:02 +00:00
..
backend Fix reasoning-only BUFFERING, pre-tool content emission, and code duplication 2026-03-27 06:45:02 +00:00
frontend feat(studio): editable context length with Apply/Reset for GGUF settings (#4592) 2026-03-25 08:32:38 -07:00
__init__.py Final cleanup 2026-03-12 18:28:04 +00:00
install_llama_prebuilt.py fix(studio): source-build fallback prefers Unsloth's tested tag over upstream latest (#4593) 2026-03-25 07:25:47 -07:00
install_python_stack.py Fix Colab huggingface-hub conflict, ensurepip fallback, bump to 2026.3.14 (#4603) 2026-03-25 09:38:02 -07:00
LICENSE.AGPL-3.0 Add AGPL-3.0 license to studio folder 2026-03-09 19:36:25 +00:00
setup.bat Final cleanup 2026-03-12 18:28:04 +00:00
setup.ps1 Fix Colab Studio launch and setup.ps1 box alignment (#4601) 2026-03-25 09:00:08 -07:00
setup.sh Fix Colab huggingface-hub conflict, ensurepip fallback, bump to 2026.3.14 (#4603) 2026-03-25 09:38:02 -07:00
Unsloth_Studio_Colab.ipynb Created using Colab 2026-03-22 04:57:26 -07:00