feat: index reasoning, and close the two-minute freshness gap (#19)
build / test (push) Has been cancelled
build / image (push) Has been cancelled

feat: index reasoning, and close the session freshness gap (#19)

Co-authored-by: David Gwilliam <dhgwilliam@gmail.com>
Co-committed-by: David Gwilliam <dhgwilliam@gmail.com>
This commit was merged in pull request #19.
This commit is contained in:
2026-11-05 03:39:16 +00:00
committed by david
parent 0218d80019
commit 84f30f293b
10 changed files with 303 additions and 59 deletions
+14
View File
@@ -54,6 +54,20 @@ definition object directly is exactly equivalent. Only `node:` builtins resolve.
Takes effect on the next `opencode service restart`.
## Session freshness
knox's watcher polls `opencode.db` every two minutes, so a finished turn is not
searchable for up to that long. The plugin runs `knox ingest sessions` at prompt
admission to close the gap.
Steady state is **~45 ms** because the sweep keeps a watermark of the newest
`session.time_updated` already indexed, so it reads only sessions touched since.
Without the watermark a sweep re-reads every message (~21 s for 59k) — the
reason this is scoped and incremented rather than a full ingest.
The first run after install has no watermark and does a full sweep (~21 s). It
is fire-and-forget, so it never delays the turn that triggered it.
## Configure
| Env | Default | Meaning |