Repository navigation
List opencode 2 sessions - #61
Merged
Merged
Conversation
opencode 2 keeps its sessions in new tables of the same database (session_v2 and session_message) and stops writing to the 1.x ones, so sessions created after the upgrade were not listed. Read the new tables when both exist; a 1.x database is read as before. Fixes #52 Claude-Session: https://claude.ai/code/session_013M2MLzr8wBaPiqkJbD3AD2
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Summary
opencode 2 keeps its sessions in new tables of the same database,
session_v2andsession_message, and stops writing tosession/message/part.ahread only the old tables, so every session created after the upgrade was missing fromah log, search,showandstats.When both new tables exist,
ahnow reads sessions from them. Upgrading copies the 1.x sessions and their messages there, so the old tables are not read in that case. A database that has not been upgraded is read as before.session_v2; aNULLtitle falls back to the first prompt, like a placeholder title does.userandassistantrows are conversation, ordered byseq.system,synthetic,compactionandidlerows are left out of turns, the transcript and search.model.idof theassistantrows that answered; the session-levelmodelcolumn is not used, since it can beNULL.ah show --rawprints one line per row as{"id":…,"type":…,"data":…}for such a database (README updated).Fixes #52
Known limitations
session_parttable of opencode 2 is not read. It is empty in the databases checked (opencode 2.2.5 as reported, 2.3.2 and 2.4.1 locally): everything is inline insession_message.data.Verification
NULLtitle, subagents,seqorder, rows of other types, values of the wrong JSON type, rows that are not JSON, export size, search, models, and the fallback when onlysession_v2exists.cargo test,cargo clippy --all-targets,cargo fmt --check,cargo +1.85 check --all-targets --lockedpass.ah -a log --agent opencodetakes 0.18s, as before.https://claude.ai/code/session_013M2MLzr8wBaPiqkJbD3AD2