fix(контракт): пустой DB_PATH, каталог вместо файла и точный разбор [DONE] (R-05, R-06)

Проверка среды отвергает пустой DB_PATH и DATA_DIR-файл; в проверке шлюза конец потока
определяется телом data, а не подстрокой в тексте.

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
anor
2026-11-18 19:31:15 +10:00
co-authored by Claude Code
parent b5f585c7ce
commit 424f9ee66f
3 changed files with 34 additions and 5 deletions
+1 -1
View File
@@ -128,7 +128,7 @@ def test_client_stream_carries_tool_calls(env, monkeypatch):
assert "[DONE]" in body
import json as _json
chunks = [_json.loads(l[5:]) for l in body.splitlines()
if l.startswith("data:") and "[DONE]" not in l]
if l.startswith("data:") and l[5:].strip() != "[DONE]"]
calls = [c["choices"][0]["delta"]["tool_calls"] for c in chunks
if (c["choices"][0].get("delta") or {}).get("tool_calls")]
first, fragments = calls[0][0], [call[0] for call in calls[1:]]