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
+18
View File
@@ -134,6 +134,24 @@ func NewIngestCmd(kdb *db.KnoxDB) *cobra.Command {
fmt.Printf("\nIngest complete: %d new entries, %d updated\n", totalNew, totalUpdated)
},
}
cmd.AddCommand(&cobra.Command{
Use: "sessions",
Short: "Re-index opencode sessions only (fast; what the watcher timer does)",
Long: `Re-index opencode sessions only.
Reads opencode.db and records just the sessions whose content changed. Used by
the OpenCode plugin to close the gap between a finished turn and the knowledge
being searchable, without paying for a full sweep.`,
RunE: func(c *cobra.Command, args []string) error {
created, changed, unchanged, err := watch.IngestSessionsNow(kdb)
if err != nil {
return err
}
fmt.Printf("sessions: %d new, %d changed, %d unchanged\n", created, changed, unchanged)
return nil
},
})
cmd.Flags().StringSliceVarP(&dirs, "dir", "d", nil, "Directories to scan (default: opencode storage/log + skills)")
return cmd
}