Skip to content

session: full-text search across session message content (only titles are searchable today) #53063

Closed as not planned

Description

@ggbdpq

Summary

Sessions are the primary artifact opencode accumulates, but their content is not searchable: the session list's search parameter only matches the session title (like(SessionTable.title, ...) in the session store's list query). Once a project has more than a handful of sessions, finding "that conversation where we fixed X" means opening sessions one by one. This proposes full-text search over session message content, built on SQLite's built-in FTS5 — no new dependencies.

Current behavior

  • GET /session list accepts search, but the store applies it only to session.title.
  • Message content lives in SQLite, so the data needed for retrieval is already there; it is just not indexed.
  • No FTS table exists in the migration set today.

Proposal

  1. Index: a session_message_fts FTS5 virtual table (contentless or external-content, tied to the message table) created by a standard migration, with a one-time backfill of existing rows.
  2. Sync: keep it fresh either via SQLite triggers or at the application write path — see open question 3.
  3. API: extend the session list query (or add a dedicated GET /session/search) returning matching sessions plus matched message snippets.
  4. TUI: a search entry in the /sessions surface that lists hits with snippets and jumps to the session.

Phased plan

  • Phase 1 — migration + backfill + store query + HTTP route (usable from the API, independently mergeable).
  • Phase 2 — TUI search surface.
  • Phase 3 (optional) — tool-call/output indexing, per-project scoping, ranking tweaks.

I'm happy to implement this; phase 1 alone is a self-contained PR.

Open questions

  1. Scope of indexed content: user + assistant text only (my default suggestion), or also tool calls/outputs? Tool output would grow the index much faster.
  2. TUI surface: search box inside /sessions, or a separate command?
  3. Index maintenance: SQLite triggers (simplest, migration-friendly) vs. writing through the application's message write path (more explicit, matches the event/projector architecture)?
  4. Index growth: acceptable to index everything unbounded per project, or should there be a cap/retention knob?

Activity

  1. github-actions commented on Oct 4, 2026

    @github-actions
    Contributor

    This issue doesn’t fully meet our contributing guidelines.

    What needs to be fixed:

    • This is a feature request, but the title should start with [FEATURE]:.
    • The feature request template’s verification checkbox is missing. The description itself has useful detail.

    Please edit this issue to address the above within 72 hours, or it will be automatically closed.


    This issue might be a duplicate of existing issues. Please check:

    If you believe this was flagged incorrectly, please let a maintainer know.

  2. ggbdpq commented on Oct 4, 2026

    @ggbdpq
    Author

    Closing in favor of #41354, which is the established track for this request (and where I've consolidated the FTS5 implementation sketch from this issue: #41354 (comment)). I missed #38973/#41354/#45801 in my pre-flight search — apologies for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

needs:complianceThis means the issue will auto-close after 2 hours.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions