Repository navigation
Conversation
A client acks a transcript-time range with PUT /api/conversations/:id/read. The server expands the range into per-message rows from its own index, records them first-ack-wins, and advances a monotonic per-conversation read point over the unbroken acked prefix. Read state lives in runtime.db, so it survives a restart and a cache clear. Conversations that existed before the upgrade read as read, through a baseline recorded once by the migration. The cache index gains counts_for_unread and last_countable_ts so the route can tell which replies are countable. read_state_changed is broadcast when an ack was new, and /api/info reports readState. List, message and session_update decoration follows in a separate change, so clients should wait for a release that carries both.
This was referenced Dec 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
First streamer half of the unread dot, tracked in #1296.
Plan: #1295
A client acks the range of replies it put on screen, and the server records read state per message, shared by every paired device.
PUT /api/conversations/:id/readtakes{ from, through }(ISO, inclusive).The server expands the range from its own index, countable replies only, skips already-acked messages, and caps one request at 500 so a resend always progresses.
Acks are first-wins, then the read point advances over the unbroken acked prefix; messages sharing a timestamp are all-or-nothing.
read_state_changedis broadcast only when at least one ack was new.runtime.db(migration012), so it survives a restart andcache clear.A baseline row recorded once by the migration makes every pre-existing conversation read as read.
counts_for_unreadandlast_countable_ts(migration032), refreshed on every ingest path./api/inforeportsreadState: true.Not in this PR
List, message and
session_updatedecoration (unread,readThrough,readAt) is the next streamer change.readState: trueis advertised before that exists, so mobile must wait for a release that carries both.Deviations from the plan
032and012(the plan says030and010).last_countable_tsis refreshed from the index (MAX(ts)over a partial index) after each index write, instead of inupdateMetaBatch.isThinkingguard is dropped from the countable rule: a thinking-only line has no text, and a line with thinking and text is still a reply.Verification
mainat 2bb24ec (server.test.tsreaping test, threedeploy-prune-buildspid-host tests).One more failure in
recursive-jsonl-watchpassed on rerun, andruntime-store.test.tsneeded the new migration added to its list, which is included.server-identity, written first.