Conversation
cbarber
force-pushed
the
fix/export-full-transcript
branch
from
March 29, 2026 20:17
b174a6d to
765cd99
Compare
The TUI message store caps at 100 entries for rendering performance; /export and /copy were reading from that store, producing truncated transcripts on compacted or long sessions. Fetch all messages from the server via a testable helper with no limit. Authored-By: OpenCode (anthropic/claude-sonnet-4-6)
cbarber
force-pushed
the
fix/export-full-transcript
branch
from
March 29, 2026 20:27
765cd99 to
7e8011b
Compare
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.
Summary
The TUI
/exportand/copycommands read from an in-memory message store capped at 100 entries for rendering performance. On sessions with compaction or more than 100 messages, this silently truncates the transcript — pre-compaction messages are stored in the database but never fetched.The fix fetches all messages directly from the server for transcript generation, matching what the CLI
opencode exportcommand already does correctly.Root cause
packages/opencode/src/cli/cmd/tui/context/sync.tsxinitialises the store withlimit: 100(newest 100 messages only) and evicts the oldest message whenever the store exceeds 100 entries. Bothsession.copyandsession.exportread from this store viamessages().Fix
Replace
messages()(in-memory store) withawait sdk.client.session.messages({ sessionID })(server fetch, no limit) in both handlers. Includes a unit test covering the >100-message and pre-compaction cases.Closes anomalyco#16765
🤖 Created by agent