fix: snippet extraction and claim lint still read the frozen v1 part table #30
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
OpenCode 2.0.24 moved conversations to
session_v2/session_message. Session ingestion was ported (internal/ingest/opencode_db.go), but two readers were left on the v1part/messagetables, which stopped being written at the migration:SnippetExtractor.ExtractAll(internal/ingest/snippets.go) queriespart p JOIN message m.claims.LoadSession(internal/claims/opencode.go) joinssession_messagetopartonp.message_id = m.id.Symptom
Nothing produced after the migration becomes a snippet candidate, and
knox claims lintsees an empty conversation. On this machinepart.time_createdstops at 2026-11-01 while sessions continue past 2026-11-05, so every session since the move yields zero candidates.Fix
Read tool calls from
session_message.data$.content[]and fall back topartonly where the v2 content is absent.v2 shape differences that matter:
$.name(v1 used$.tool), status at$.state.statuswrite/editinput carriespathas well asfilePath$.state.content[]{type,text}, not$.state.outputshellis used as a tool name alongsidebashpatchpart type in v2, soPatchHashis empty for v2-sourced candidates (it is stored as metadata only; supersession is computed from the last fullwrite)Expected
Snippet candidates and claim lint pick up sessions written after the migration, with no duplicates for sessions that exist in both shapes.