Repository navigation
Fix missing recent replies with OpenCode 2.4 - #203
Merged
Merged
Conversation
OpenCode 2.4 writes each part as its own session_part row and leaves the assistant payload's content empty, so the reply list showed nothing for new sessions and lost the newest replies on resumed ones. Decide the source per reply: text in session_message.data.content wins, and a reply without visible text falls back to its text parts in ordinal order. The part table is checked once per read and its statement reused per message; a database without the table still reads the payload alone.
A part row that will not parse was silently dropped, so a reply could vanish without a word. The part reader now fails with the operation, session, message and database path, while a message payload that will not parse stays skipped as before: it was never selected for its parts, and one bad row must not hide the session. The module outgrew one file, so it splits by responsibility: session picking, the two message readers, the 2.4 part reader, and the shared payload rules that decide what counts as reply text for every source. The public surface is unchanged. The mixed fixture test asserted order, dedup, identity and the limit at once, so a failure named none of them. Each invariant now has its own test, and the fixtures moved to a shared module. The part fixture also covers an ignored part and a reasoning part beside a text part.
…le parts Its query filters with json_extract, which fails the read on a malformed part row.
A session whose replies all carry payload text no longer depends on the session_part columns, so a later change to that table cannot break it.
backnotprop
approved these changes
Nov 25, 2026
backnotprop
left a comment
Contributor
There was a problem hiding this comment.
Thanks for tracking this down and fixing it so thoroughly. Reading the reply text from OpenCode 2.4's session_part rows while keeping older databases read-only and unchanged is the right approach, and the mixed-history tests make it easy to trust. I pushed a few small maintainer commits (the design notes moved into docs/decisions.md, and the part query is prepared on first use). Going out in 0.11.8.
This was referenced Nov 25, 2026
Merged
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.
Problem
With OpenCode 2.4,
plannotator-tui last --host opencodeand Herdr's reply picker skip recent replies or report that there are no assistant messages. OpenCode now stores assistant text insession_partrows whilesession_message.data.contentcan be empty. A resumed session can contain both formats.Change
Verification
cargo test --workspace(1,242 passed)cargo clippy --workspace --all-targetscargo fmt --all --checklast --host opencode --session-id <id> --printreturns the recent reply from an affected OpenCode 2.4.1 session.Ctrl+B, thenShift+O) with the patched plugin binary.