Skip to content

feat(server): add bounded thread content search - #8721

Closed
juliusmarminge wants to merge 4 commits into
t3code/codex-turn-mappingfrom
agents/mcp-thread-search/search
Closed

juliusmarminge wants to merge 4 commits into
t3code/codex-turn-mappingfrom
agents/mcp-thread-search/search

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Aug 30, 2026 •

Copy link
Copy Markdown
Member

Problem

The existing thread search RPC is global, active-only, and cannot return stable anchors into the visible V2 timeline. MCP callers need project-scoped search without changing that established client wire behavior.

Change

Add an opt-in, bounded ProjectionSnapshotQuery.searchThreadContent path that searches durable titles plus visible user and assistant messages. The query:

  • scopes every result to one project and an optional thread
  • defaults to active threads with an explicit archived opt-in
  • excludes deleted projects and threads, streaming output, rolled-back runs, cancelled queued messages, and inherited-only fork content
  • treats V2 metadata as authoritative while retaining legacy-only threads
  • bounds title and message fragments in SQL before decoding
  • escapes literal %, _, and !, rejects NUL, and preserves valid Unicode and internal whitespace
  • returns live offset pagination and real source identities when available

The existing searchThreads RPC and cache shape are unchanged.

Behavior

Results are deterministic within each live query page. Legacy hits keep nullable anchors instead of inventing V2 identifiers. V2 title, archive, and deletion state cannot be shadowed by stale legacy rows.

Validation

  • vp test run apps/server/src/orchestration/Layers/ProjectionSnapshotQuery.search.test.ts (3/3)
  • real in-memory SQLite coverage for V2 and legacy metadata authority, archived/deleted scope, literal wildcard and whitespace matching, Unicode bounds, queued visibility, and pagination
  • scoped t3, @t3tools/contracts, and @t3tools/shared typechecks
  • targeted lint, format, and git diff --check

Dependency

Bottom of native stack #8785. Based on t3code/codex-turn-mapping at 415ed0f73b97f1655b6282492f81d0b2bba3a9cc. The dependent MCP tool is #8722.

Implemented by GPT-5.6-Sol via Codex in T3 Code.

@coderabbitai

coderabbitai Bot commented Aug 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: 518d8c0a-3725-4031-bd73-87965881274a

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

Warning

Your free Security trial is over. An organization admin can activate Security or dismiss this notice.


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

@juliusmarminge
juliusmarminge marked this pull request as ready for review August 30, 2026 01:45
@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Aug 30, 2026
@github-actions github-actions Bot added the size:L 100-499 changed lines (additions + deletions). label Aug 30, 2026

@macroscopeapp macroscopeapp 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.

Effect service conventions review: one finding on the new service failure type.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/orchestration/Services/ProjectionSnapshotQuery.ts Outdated
Comment thread apps/server/src/orchestration/Layers/ProjectionSnapshotQuery.ts
@github-actions

github-actions Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

⚠️ The latest CI run did not produce a thread transfer result for 298b869.

This comment will update automatically after the next completed run.

@macroscopeapp macroscopeapp 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.

One convention finding: the new service failure still carries an unstructured message as its only attribute.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/orchestration/Services/ProjectionSnapshotQuery.ts Outdated

@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 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON, but a cloud agent failed to start.

Reviewed by Cursor Bugbot for commit 0d5b88c5b5c898c171adb3d74c2069c1e8f46a26. Configure here.

Comment thread apps/server/src/orchestration/Layers/ProjectionSnapshotQuery.ts
@macroscopeapp

macroscopeapp Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR adds a new production thread-content search capability with a substantial cross-generation SQL query, visibility rules, deduplication, pagination, and snippet processing. It is opt-in and well-tested without changing existing callers or product defaults, but the scope and runtime complexity warrant human review.

No code changes detected at 298b869. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

@juliusmarminge
juliusmarminge force-pushed the agents/mcp-thread-search/search branch 2 times, most recently from c687679 to 0fc6b46 Compare August 30, 2026 02:00
@github-actions github-actions Bot added size:XL 500-999 changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels Aug 30, 2026
@juliusmarminge
juliusmarminge changed the base branch from agents/mcp-controls/base-490318a to t3code/codex-turn-mapping August 30, 2026 17:31
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-thread-search/search branch from ff4bba4 to 7f421bc Compare August 30, 2026 17:31
@github-actions github-actions Bot added the 📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. label Aug 30, 2026
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-thread-search/search branch from 7f421bc to b57d3d8 Compare August 30, 2026 20:14
Comment thread apps/server/src/orchestration/Layers/ProjectionSnapshotQuery.ts Outdated
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-thread-search/search branch from d22f88d to a9b92ca Compare September 5, 2026 05:57
@juliusmarminge

Copy link
Copy Markdown
Member Author

Superseded as the active MCP proposal by #10561 in the rebuilt MCP stack, following the maintainer request to review thin service wrappers separately from service hardening.

This is not a full feature-parity replacement. This filters the global top results, so a project can underfill the requested limit. It is not exhaustive or paginated. Project-first SQL pagination and search-service correctness changes belong in a separate service PR.

Closing this mixed proposal without merging. The remote branch agents/mcp-thread-search/search and exact head 298b869dc63809571f15ec9f92eaf1740c7b53f7 are retained so the service changes can be extracted for separate review later.

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

Labels

📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. 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