feat(opencode): add turn-level transcript recall#506
feat(opencode): add turn-level transcript recall#506InSciTech wants to merge 2 commits intozilliztech:mainfrom
Conversation
|
Thanks for putting this together. The issue makes sense to me: OpenCode L3 recall currently only has session-level drill-down, so long sessions need a stable turn cursor. I have one design question before merging this: is From reading the PR, the minimal L3 path seems to be:
That would solve the transcript drill-down problem without introducing another sidecar DB. The sidecar DB does seem useful for replacing If we keep the sidecar DB in this PR, I think we should make a few things explicit:
Overall I like the direction, but I would prefer we treat the sidecar DB as a deliberate capture-checkpoint design change, not just an implementation detail of |
Document OpenCode SQLite as the source of truth for transcript recall and add replay regression coverage so sidecar failures stay recoverable without duplicate markdown writes.
|
You're reading the branch correctly: On the design question: transcript reads still rebuild turns from the OpenCode SQLite database on demand. The sidecar is derived capture state only: replay-safe checkpoints and stable turn ordering for the daemon. I also updated the PR description so it no longer frames the sidecar as part of the transcript read path. On the recovery-path point: the current write order is markdown append ->
This update adds or confirms coverage for those paths:
On the source-of-truth point: I clarified in code and docs that:
I also added On the other review items:
If you'd still prefer the sidecar/checkpoint work to be split after this clarification, I can do that next. |
|
Thanks for the update. The clarification that transcript reads still rebuild from the OpenCode SQLite DB, and that I did one more pass and found two edge cases I think are worth handling before merge:
This PR switches capture progress to the new sidecar state. For an existing user who already has <!-- session:... db:... -->but no That could cause an upgrade to replay/re-summarize recent OpenCode session history and append duplicate memory entries. Could you add either a small migration path from
For example: In this shape, Other than those two points, the updated direction looks good to me. |
Closes #505
Summary
turn_id/contexttranscript drill-down for the OpenCode plugin.memsearch/opencode-turns.dbas derived capture state for checkpoints and stable replay orderingTest Plan
uv run python -m pytest tests/test_opencode_turns.py tests/test_opencode_parse_transcript.py -vuv run ruff check tests/test_opencode_turns.py tests/test_opencode_parse_transcript.py plugins/opencode/scripts/parse-transcript.py plugins/opencode/scripts/opencode_turns.py plugins/opencode/scripts/capture-daemon.py