Skip to content

fix(server): full text in v1 history, and report an unreachable database - #532

Merged
mrnasil merged 3 commits into
mainfrom
fix/v1-history-and-health
Dec 2, 2026
Merged

mrnasil merged 3 commits into
mainfrom
fix/v1-history-and-health

Conversation

@mrnasil

@mrnasil mrnasil commented Dec 2, 2026

Copy link
Copy Markdown
Member

From the same source audit as #527–#531 (the two low-severity findings).

History

GET /v1/sessions/:id/messages built each message's content from its first text block only. A message with several text blocks was cut short, and a tool-only or image-only message came back as an empty string, so a reconnecting SDK client saw blank steps. content now joins every text block (and a compaction summary), and marks what is not text: [tool call: <name>], the tool result text, [image]. Thinking blocks stay out. No protocol change.

Storage

GET /v1/health always said healthy: true, and the session list silently left out saved sessions when the database could not be opened, which reads as "no saved sessions".

  • Handshake.storage_ok (bool): false when the daemon cannot open its database. Absent means true, so an older daemon parses as before.
  • SessionList.partial (bool, only sent when true): the database could not be read and only in-memory sessions are listed.

healthy keeps its meaning (the process answers). The TypeScript SDK types and parseHandshake carry the new fields; python scripts/check_sdk_protocol.py passes.

Verification

  • New Rust tests for every block kind in the history text, for both storage flags with a working and an unopenable database, and for the wire format of the new fields; a TypeScript test for the storage_ok default.
  • Linux line coverage of whycodes-protocol and whycodes-server measured locally: no missed lines. npm run build and npm test pass in sdk/typescript.

🤖 Generated with Claude Code

- GET /v1/sessions/:id/messages returned only the first text block of a
  message, so a tool-only or image-only message came back empty. It now joins
  every text block and marks tool calls and images.
- GET /v1/health gains `storage_ok` and the session list gains `partial`:
  a database that cannot be opened no longer reads as a healthy daemon with
  no saved sessions. Both default to the old meaning when absent.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@mrnasil
mrnasil merged commit 7ae65fb into main Dec 2, 2026
7 checks passed
@mrnasil
mrnasil deleted the fix/v1-history-and-health branch December 2, 2026 19:26
@mrnasil mrnasil mentioned this pull request Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant