Skip to content

feat(search): find threads by conversation content - #4959

Merged
t3dotgg merged 3 commits into
mainfrom
t3code/search-thread-messages-outputs
Jul 30, 2026
Merged

feat(search): find threads by conversation content#4959
t3dotgg merged 3 commits into
mainfrom
t3code/search-thread-messages-outputs

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Jul 30, 2026

Copy link
Copy Markdown
Member

Thread search only matched shell metadata, so finding older work by what was actually said or delivered was frustrating.

This adds a bounded search RPC for user messages and canonical final agent responses. Web, desktop, and mobile query connected environments after a 200 ms debounce, preserve instant local title/project/branch matching, and fall back cleanly when an environment is disconnected or running an older server. Content matches show the selected variant C You: / Agent: excerpt without replacing existing thread metadata.

Design preview: selected variant C mock

Real screenshot
image

Verification:

  • 60 focused contract, query, client-runtime, web, and mobile tests
  • WebSocket RPC routing test
  • Contracts, client-runtime, web, mobile, and server typechecks
  • Targeted lint and diff checks

Built with GPT-5.6 Sol in the Codex harness.


Note

Medium Risk
New read RPC and SQL search over message projection data with bounded inputs; broad UI surface (web palette, mobile lists) but no auth or write-path changes.

Overview
Adds thread content search so users can find work by what was said or delivered, not only thread titles and project metadata.

Server & contracts: New orchestration.searchThreads WebSocket RPC (orchestration read scope) queries projection tables for user messages and canonical final assistant outputs on active, non-archived threads. Results are bounded (query length, limit), deduped to one match per thread, and include snippets. Interim assistant text, system messages, archived/deleted threads, and literal % in queries are handled safely in SQL.

Client-runtime: Shared thread-search module merges per-environment RPC results via atom families; failed or older servers are ignored so local title/project/branch matching still works.

Web: Command palette uses debounced useThreadSearch (≥2 chars, connected environments) and shows You: / Agent: excerpts with highlighted terms under thread rows without replacing project/branch context. Pending search shows “Searching thread messages…”.

Mobile: Home and thread navigation sidebar wire the same search into v1 groups and thread list v2 filtering via matchedThreadKeys, pass excerpts into list rows, and gate empty states while search is pending. Environment filter options include connection state so only connected environments are searched.

Docs: Keybindings doc notes palette message search behavior.

Reviewed by Cursor Bugbot for commit 1fc3070. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add thread message content search to command palette and thread list sidebar

  • Adds a searchThreads RPC method to the orchestration WebSocket layer, backed by a new SQL query in ProjectionSnapshotQuery.ts that searches user messages and canonical assistant outputs in active threads, deduplicating to one match per thread.
  • Introduces threadSearch.ts with createThreadSearchResultsAtomFamily and useThreadSearch hooks (web and mobile) that debounce queries, fan out across connected environments, and aggregate results.
  • Thread list sidebar (mobile) and command palette (web) now filter results by message content matches in addition to title, and render a labeled, highlighted snippet excerpt per match.
  • Empty states show "Searching thread messages…" while results are pending; search requires at least 2 characters and uses SQLite ASCII case-insensitive LIKE matching.
  • Risk: each keystroke (after debounce) issues a WebSocket RPC per connected environment; failures from individual environments are silently ignored.

Macroscope summarized 1fc3070.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a4be1a37-3d12-4968-9122-0f76a9df4e71

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions github-actions Bot added size:XL 500-999 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Jul 30, 2026
Comment thread packages/client-runtime/src/state/threadSearch.ts
Comment thread apps/mobile/src/features/home/HomeScreen.tsx

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2683db9. Configure here.

Comment thread apps/mobile/src/features/home/HomeScreen.tsx
Comment thread apps/mobile/src/features/home/HomeScreen.tsx
@macroscopeapp

macroscopeapp Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces a new search feature enabling users to find threads by conversation content, including new server-side RPC endpoints, database queries, client state management, and UI components. New features introducing user-facing capabilities warrant human review.

You can customize Macroscope's approvability policy. Learn more.

@t3dotgg
t3dotgg merged commit 4b71a2a into main Jul 30, 2026
17 checks passed
@t3dotgg
t3dotgg deleted the t3code/search-thread-messages-outputs branch July 30, 2026 12:30
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Jul 30, 2026
## What's Changed
* fix(mobile): support dragged images in the composer by @t3dotgg in pingdotgg/t3code#4953
* fix(mobile): stop long iOS threads from jumping while scrolling up by @t3dotgg in pingdotgg/t3code#4867
* fix(web): keep worktree default when switching a draft's machine by @t3dotgg in pingdotgg/t3code#4964
* perf(mobile): reconnect environments immediately on resume by @t3dotgg in pingdotgg/t3code#4878
* feat(web): pasting a huge screenshot now compresses it instead of erroring by @t3dotgg in pingdotgg/t3code#4967
* feat(web): regenerate thread titles from sidebar by @t3dotgg in pingdotgg/t3code#4810
* fix(web): show server update progress through reconnect by @t3dotgg in pingdotgg/t3code#4903
* feat(search): find threads by conversation content by @t3dotgg in pingdotgg/t3code#4959
* fix: marketing site Vercel builds no longer die after ~100 deploys by @t3dotgg in pingdotgg/t3code#4975


**Full Changelog**: pingdotgg/t3code@v0.0.32-nightly.20260730.955...v0.0.32-nightly.20260730.956

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.32-nightly.20260730.956
juliusmarminge added a commit that referenced this pull request Jul 30, 2026
27 commits from main, including the ⌘P file picker / ⇧⌘F content search
(#4855), thread content search (#4959), sidebar title regeneration
(#4810), image-paste compression (#4967), and the docs restructure
(#4807). Notable resolutions beyond keep-both:

- Thread content search is ported to the v2 surface: searchThreads joins
  ORCHESTRATION_V2_WS_METHODS/rpc/auth scopes, and the SQL now UNIONs
  orchestration_v2_projection_messages so current threads are searchable,
  not just legacy-projected ones.
- Title regeneration's server half lived in the v1 ProviderCommandReactor
  this branch deletes, so the capability is deliberately not advertised:
  clients hide the action, the contract/UI code stays intact, and the
  input field is accepted as a documented no-op.
  TODO(orchestration-v2): port regeneration to the v2 runtime.
- Main's 035_ProjectionThreadTitleRegeneration migration collided with
  this branch's 035-043 range; renumbered to 044.
- Mobile activity grouping keeps this branch's runId/prominence semantics
  while adopting main's O(1) trailing-group optimization (prominence
  tracked in a flag instead of a per-append scan).
- v1-only startup tests from main (heartbeat/auto-bootstrap against the
  deleted reactor-era services) are dropped; their v2 equivalents already
  cover the ordered startup phases.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant