[PR #2674] [CLOSED] serve: log a reply that ended after its thinking with no text and no call (which end: inside the thinking or after </think>) #4207

Closed
opened 2026-11-07 15:34:01 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2674
Author: @page1
Created: 10/15/2026
Status: ❌ Closed

Base: main ← Head: feature/log-empty-answer


📝 Commits (1)

  • da95008 serve: log a reply that ended after its thinking with no text and no call (which end: inside the thinking or after )

📊 Changes

1 file changed (+7 additions, -0 deletions)

View changed files

📝 serve/server.py (+7 -0)

📄 Description

Title

Issue: related to #1053

Summary

Agents sometimes get a turn that thinks and then stops with nothing to show: no text and no tool call. There are two ways to get there: the model ends while the parser is still in the reasoning (#1053's case, which "reasoning_close_retry" continues), or it closes </think> and stops. The server said nothing either way. Now it prints one line saying which it was.

What changed

  • serve/server.py: when a reply that had thinking finishes with stop, no answer and no cancel, one line is printed with the parser state, the text it held and the last 12 tokens:
[strata] empty answer: the reply ended after its thinking with no text or call (parser=reasoning, held='', tail='...')

What it leaves alone: every reply. It only prints.

Extra Notes

Seen in use: 15 such lines while replaying real opencode sessions on IQ3_S (RTX 3090, Windows 11), all of the first kind (parser=reasoning, nothing held).

Tests: all 43 serve/test_*.py suites pass. serve.test_responses failed 2 times in 21 runs on this branch, both in NoLeakedSampler.test_server_close_ends_the_sampler, a thread-count test. The same test failed 1 time in 24 runs on v0.1.44.1 under the same load (and 0 times in 24 runs on this branch), so it looks timing-sensitive rather than caused by this change.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/2674 **Author:** [@page1](https://github.com/page1) **Created:** 10/15/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feature/log-empty-answer` --- ### 📝 Commits (1) - [`da95008`](https://github.com/Niko1221/Strata/commit/da95008b5d8263a140525b03259bef1a442ec506) serve: log a reply that ended after its thinking with no text and no call (which end: inside the thinking or after </think>) ### 📊 Changes **1 file changed** (+7 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `serve/server.py` (+7 -0) </details> ### 📄 Description ## Title Issue: related to #1053 ## Summary Agents sometimes get a turn that thinks and then stops with nothing to show: no text and no tool call. There are two ways to get there: the model ends while the parser is still in the reasoning (#1053's case, which `"reasoning_close_retry"` continues), or it closes `</think>` and stops. The server said nothing either way. Now it prints one line saying which it was. ## What changed - `serve/server.py`: when a reply that had thinking finishes with `stop`, no answer and no cancel, one line is printed with the parser state, the text it held and the last 12 tokens: ``` [strata] empty answer: the reply ended after its thinking with no text or call (parser=reasoning, held='', tail='...') ``` What it leaves alone: every reply. It only prints. ## Extra Notes Seen in use: 15 such lines while replaying real opencode sessions on IQ3_S (RTX 3090, Windows 11), all of the first kind (`parser=reasoning`, nothing held). Tests: all 43 `serve/test_*.py` suites pass. `serve.test_responses` failed 2 times in 21 runs on this branch, both in `NoLeakedSampler.test_server_close_ends_the_sampler`, a thread-count test. The same test failed 1 time in 24 runs on v0.1.44.1 under the same load (and 0 times in 24 runs on this branch), so it looks timing-sensitive rather than caused by this change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:34:01 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4207
No description provided.