Add provider thread IDs and safe cross-thread reads
Summary
- Persist and expose provider-native thread IDs alongside T3 Code thread IDs without changing the existing T3 ID action.
- Add explicit
Copy Codex Thread ID/Copy Provider Thread IDcontext-menu actions in both sidebar variants. - Register a read-only
read_threadMCP tool that resolves either a T3 thread ID or a provider-native ID and returns bounded recent messages/activity without resuming, steering, or mutating the target thread. - Preserve the existing preview MCP toolkit and require an explicit
thread-readcapability on issued same-environment MCP credentials.
Compatibility and safeguards
- The orchestration field is optional and the existing nullable projection column is reused, so no migration is required.
- Legacy rows with a SQL
NULLprovider thread ID continue to decode. - Existing
Copy Thread IDbehavior remains available and distinct. - Cross-thread results are bounded (1โ200 items per category, default 50), read-only, and limited to the authenticated T3 server environment.
Verification
vp run --filter @t3tools/contracts --filter t3 --filter @t3tools/web typecheck- Targeted formatting and lint on all 21 changed files (lint under the repository-pinned Node 24.13.1 runtime)
- 19 focused web/MCP/projection tests passed
- Focused provider runtime ingestion test passed
- 5 MCP HTTP/preview registration and transport tests passed with local socket permission
- Isolated
test-t3-appenvironment launched successfully, migrations completed, and the pairing route was produced. Automated UI interaction could not be completed because the native preview bridge required authentication and the fallback in-app browser reported no available browser surfaces; no alternate browser was used to bypass that authentication constraint.
[!NOTE]
Add provider thread IDs to sessions and expose a
read_threadMCP tool
- Captures
providerThreadId(e.g. Codex, Claude) on thread start and propagates it through session state changes, projections, and theOrchestrationSessioncontract.- Persists
provider_thread_idin theprojection_thread_sessionstable and surfaces it viaProjectionSnapshotQuery.- Adds a
read_threadMCP tool in a newThreadControlToolkitthat fetches thread metadata and bounded message/activity history by T3 or provider thread ID, enforcing athread-readcapability check.- Newly issued MCP credentials include the
thread-readcapability alongsidepreview.- Adds "Copy Provider Thread ID" context menu items to both Sidebar and SidebarV2 in the web UI.
๐ Macroscope summarized d86586d. 13 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted
๐๏ธ Filtered Issues
No issues evaluated.
[!IMPORTANT]
Review skipped
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.โ๏ธ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
bd4c49e2-66b5-4db4-9529-80f8963e785eYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
- [ ] ๐ Trigger review
โจ Finishing Touches
๐งช Generate unit tests (beta)
- [ ] Create PR with unit tests
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.
Comment @coderabbitai help to get the list of available commands.
Closing in favor of #2829 (orchestration V2).
#2829 replaces the V1 orchestration engine wholesale, and the behavior this PR adds already landed there natively โ so this change is a no-op against the new base.
Thanks for the work here, and sorry for the churn on a long-lived branch. Once #2829 merges, please rebase onto main and reopen if the behavior is still missing โ happy to take it.
@juliusmarminge Thanks captain, roger that.