feat: index reasoning, and close the two-minute freshness gap #18
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?
Two gaps that make the index lag behind the work.
1. Reasoning was discarded
loadOCTranscriptsindexed user text and assistant text parts only. The model's reasoning — where a decision is actually justified — was explicitly excluded, so "why did you do that" was unsearchable.It is also large: individual reasoning parts reach 175 KB. Each part is truncated to 1.2 KB and each session is budgeted 4 KB. It goes into
content(searchable) but not intosummary, which is what search results and MCP output display.Bug this exposed: the session sweep skipped a session when
created_atandsummarymatched. Content that gained reasoning behind unchanged prose was therefore never recorded.IngestResultnow carries a content hash and the sweep compares it — the observation layer already used that signal internally, only the pre-check bypassed it.2. Finished turns were stale for up to two minutes
The watcher polls
opencode.dbevery 2 minutes. A turn was not searchable until the next tick.IngestSessionsNowshares the watcher's logic (no duplication).opencode_sync_max_updated).Side effect: the watcher's own 2-minute sweep drops from ~20 s to ~45 ms.