Pull requests / #2674

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

open · @page1 · 0 Kommentare · Auf GitHub

Server & APINVIDIA / CUDAModels & quantsWindows

Beschreibung

## 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)

Mehr auf der Site

Links zu Install, Modellen, Releases.