fix(opencode): reasoning-fallback в вердикте + API-логи в debug-уровень
Some checks failed
CI / test (pull_request) Failing after 1m21s
CI / build-and-package (amd64, linux) (pull_request) Failing after 1m1s
CI / build-and-package (amd64, windows) (pull_request) Successful in 23s

- verdict(): если в завершённом assistant-сообщении нет text-парта, но есть
  reasoning — вердикт собирается из reasoning (fallback), а не падает с
  'нет text-части в ответе'. Решает сбой dev/reviewer/postmortem на моделях,
  отвечающих только thinking (например, через прокси tokentool).
- Отладочные логи API-вызовов (запрос/ответ) помечены маркером 'debug',
  чтобы в панели «Логи» они классифицировались как debug, а не info.
This commit is contained in:
ki.sagidullin
2026-08-23 14:43:05 +05:00
parent 963e7b478e
commit 8cf4fc9f7c
5 changed files with 118 additions and 12 deletions

View File

@@ -85,6 +85,8 @@ func TestClassifyLevel(t *testing.T) {
{"app: db opened /tmp/r.db", LevelInfo},
{"app: worker started", LevelInfo},
{"opencode: debug: poll request", LevelDebug},
{"opencode api debug: prompt -> POST http://127.0.0.1:4096/api/session", LevelDebug},
{"opencode api debug: messages response (512 bytes)", LevelDebug},
{"trace: session resumed", LevelDebug},
{"tg: warn: long poll timeout", LevelWarning},
{"ПРЕДУПРЕЖДЕНИЕ: конфиг не задан", LevelWarning},
@@ -119,4 +121,4 @@ func TestLogWriterClassifiesLevels(t *testing.T) {
if second.Level != LevelError || second.Text != "ERROR: boom" {
t.Fatalf("unexpected second: %+v", second)
}
}
}