phraser: report the failure next to the fallback (V-397)

PhraseChat and PhraseQuery returned canned text with a nil error, so a dead
or OOM-killed server was indistinguishable from bad phrasing — "не знаю." is
also a legitimate answer.

Both now return the fallback text AND the error. The daemon keeps using the
text, so the turn still survives; a measuring caller counts a real failure.
An empty response is its own error: the model is up and said nothing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-04 00:41:16 +04:00
parent 71041029e2
commit d1f8a734c5
4 changed files with 103 additions and 21 deletions
+5
View File
@@ -37,6 +37,11 @@ type Remote interface {
// (docs/evals/2026-08-02-workstation-gemma4-12b.md).
var ErrNoWorldModel = errors.New("phraser: no world model available")
// errEmptyResponse — the server answered and said nothing. A separate error from
// a transport failure because it means the model is up and produced no tokens,
// which is still not an answer and must not score as one.
var errEmptyResponse = errors.New("phraser: empty response from the model")
// chatTemperature — what the phraser's own transport has always sampled at.
// Named so the remote path cannot drift from it silently. Whether 0.7 is right
// at all is Vikunja #402, and answering that here would hide a phrasing change