Summary
tests/test_api.sh reads /api/sessions with json.load(sys.stdin) and indexes it as a list (lines 50, 56, 63). Since the single-scan/streaming-progress change, that endpoint returns newline-delimited JSON — a {"type":"meta",...} line followed by one {"type":"session","data":{...}} line per session (server.py:1508-1514, Content-Type: application/x-ndjson).
Symptom
The "Sessions API" test block errors:
json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 31)
and every later assertion that reuses session_id from that parse is skipped.
Fix options
- Update the test to consume NDJSON (split lines, drop the
meta line, read .data), or
- have the test request a non-streaming variant if one is added.
Notes
Independent of #2 (which is about the --tailscale loopback bind). Confirmed against a localhost instance where the server was reachable — the parse still fails. Found 2026-07-08 while adding the user-message classifier tests (unrelated code path; the Python unittest suite is green).
Summary
tests/test_api.shreads/api/sessionswithjson.load(sys.stdin)and indexes it as a list (lines 50, 56, 63). Since the single-scan/streaming-progress change, that endpoint returns newline-delimited JSON — a{"type":"meta",...}line followed by one{"type":"session","data":{...}}line per session (server.py:1508-1514,Content-Type: application/x-ndjson).Symptom
The "Sessions API" test block errors:
and every later assertion that reuses
session_idfrom that parse is skipped.Fix options
metaline, read.data), orNotes
Independent of #2 (which is about the
--tailscaleloopback bind). Confirmed against a localhost instance where the server was reachable — the parse still fails. Found 2026-07-08 while adding the user-message classifier tests (unrelated code path; the Pythonunittestsuite is green).