Skip to content

Search messages across every bot and room - #186

Closed
aivsomkar wants to merge 5 commits into
mainfrom
feat/harness-1.7-search
Closed

Search messages across every bot and room#186
aivsomkar wants to merge 5 commits into
mainfrom
feat/harness-1.7-search

Conversation

@aivsomkar

@aivsomkar aivsomkar commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

In plain language

Before: the sidebar search only filtered bots by name. A phrase said three weeks ago in some bot's task was unfindable.

What changes in the app: type two or more characters in the sidebar search and a Messages section appears with hits from every bot's tasks and every room — bot, task title, highlighted snippet, time. Tool runs are searchable too ("which bot ran that migration"). Click a hit and you land on that message: right bot, right task, right version of the conversation (it switches the branch only if the hit is on an old version), scrolled to and briefly highlighted.


In plain terms

A roster of bots, threads that live for weeks, and no way to find anything — the sidebar search only filtered bots by name. Now it also finds messages across every bot's tasks and every room, and clicking a hit lands you on that message: right bot, right task, right branch.

Changes

  • server/search.ts + GET /api/search?q=&bot=&kind=&limit= — linear scan over every bot task and room thread (threads are already in memory once touched; an index would be premature). Matches text and, for activity chips, the tool name — so "which bot ran that migration" works. Each hit: owner, task title, role/kind, windowed snippet with match offset, onActivePath.
  • Sidebar: from 2 characters, a Messages section under the bot list — avatar, task title, highlighted snippet, time; hits off the visible branch get an "other version" tag. Debounced 250 ms.
  • Landing on a hit: select bot/room → switch task if it's another one → POST /active-branch only when the hit is off the visible branch (that rewinds the leaf and marks the provider session stale, so it's never done idly) → scroll to and flash the message. Search box clears.
  • focusMessage state + useFocusMessage hook; message rows carry data-mid (they're display: contents wrappers, so the hook scrolls/highlights the child). Works in ChatView and GroupView.

Not in scope: fuzzy/regex, an index, searching inspector logs, in-thread find (⌘F).

Item 1.7 of docs/plans/agent-harness-upgrades-v2.md.

Test plan

  • server/search.test.ts (6): case-insensitive across bots and rooms newest-first; active-path flag on a branched thread; tool-name + text search for activity with kind filter; bot filter + limit; snippet windowing/ellipsis and match offset; empty query
  • pnpm typecheck clean; pnpm vitest run green (65 files, 533 passed)
  • Manual on real data: yin finds hits in two of one bot's tasks; clicking switches task and scrolls/flashes; activity hits show the wrench; hits off the visible branch switch versions

🤖 Generated with Claude Code

aivsomkar and others added 2 commits August 17, 2026 18:57
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A roster of bots, threads that live for weeks, and no way to find
anything: the sidebar box only filtered bots by name.

- server/search.ts + GET /api/search?q=&bot=&kind=&limit=: a linear scan
  over every bot task and room thread (threads are in memory once
  touched; an index would be premature). Matches text and, for activity
  chips, the tool name — "which bot ran that migration" is a tool-name
  question. Each hit carries a windowed snippet with the match offset and
  whether it sits on the visible branch.
- Sidebar: from two characters the box also shows a Messages section —
  avatar, task title, highlighted snippet, time, an "other version" tag
  for hits off the visible branch. A click lands on the message: select
  the bot or room, switch to the task if needed, switch the version ONLY
  when the hit is off the visible branch (that rewinds the leaf and marks
  the session stale, so never idly), then scroll to and flash it.
- focusMessage state + useFocusMessage: rows carry data-mid; works in
  ChatView and GroupView.

Item 1.7 of docs/plans/agent-harness-upgrades-v2.md.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@milind-soni, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 28 minutes

Limit details: You’ve used all 3 included reviews currently available under your plan.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 66d48196-6077-43bc-bcc5-59b8e0cc50e7

📥 Commits

Reviewing files that changed from the base of the PR and between 8c7bd1a and 3203756.

📒 Files selected for processing (10)
  • server/index.test.ts
  • server/index.ts
  • server/message-db.test.ts
  • server/message-db.ts
  • src/components/ChatView.tsx
  • src/components/GroupView.tsx
  • src/components/SearchResults.tsx
  • src/components/Sidebar.tsx
  • src/lib/focus-message.ts
  • src/state/store.tsx

Comment @coderabbitai help to get the list of available commands.

@aivsomkar aivsomkar added the enhancement New feature or request label Aug 17, 2026
aivsomkar and others added 3 commits August 18, 2026 01:03
main's #192 moved transcripts to SQLite and shipped its own /api/search
(a LIKE scan) plus a basic "In conversations" list. Reconciled so there
is one search: main's endpoint and data path stay; my in-memory scan
(server/search.ts) is dropped. On top of main's endpoint: activity chips
are searchable by tool name (json_extract on the row), each hit carries
the match offset for highlighting, room attribution, and whether it sits
on the visible branch. The sidebar keeps this PR's SearchResults UI
(highlighted snippet, "other version" tag, land on the message with the
right task and branch, scroll + flash) in place of main's inline list.
Also drops a stray plan-doc copy that had been committed here by mistake.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@milind-soni

Copy link
Copy Markdown
Owner

Superseded by #213, which preserves this PR’s useful transcript search and exact-message landing while integrating it with the newer Cmd+K palette and bounded transcript windows. #213 also addresses the review findings around stale focus replay, deleted conversations, fallback highlighting, and duplicate landing logic, and has now merged green.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants