Skip to content

feat(mcp): update thread metadata - #8690

Merged
juliusmarminge merged 5 commits into
t3code/codex-turn-mappingfrom
agents/mcp-thread-metadata/update
Sep 6, 2026
Merged

feat(mcp): update thread metadata#8690
juliusmarminge merged 5 commits into
t3code/codex-turn-mappingfrom
agents/mcp-thread-metadata/update

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Aug 29, 2026

Copy link
Copy Markdown
Member

Problem

Provider agents can read thread history but cannot safely rename a thread, regenerate its title, or link and unlink a pull request through the app-owned MCP workflow.

Change

Add t3_thread_update with a provider-compatible object-root schema and typed metadata actions. A focused service keeps updates in the current project, uses V2 commands and idempotent receipts, and returns committed title, title-regeneration, and linked-PR state. Thread list/read expose the corresponding read path; docs and tool presentation cover the user-visible behavior.

Behavior

threadId defaults to the calling thread. Rename requires title; link requires repository, number, and URL; regenerate and unlink take no action-specific payload. Branch and workspace mutations remain outside this tool.

Validation

  • Focused contracts, toolkit schema, presentation, and real MCP/V2 integration tests (4 files, 14 tests)
  • Targeted lint for changed TypeScript files
  • Contracts, shared, and server package typechecks

Dependency

Depends on #8689, which fixes V2 linked-pull-request persistence. Native stack #8709: #8689#8690, rooted at agents/mcp-controls/base-490318a. It remains independent from thread organization stack #8708.

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

Note

Add t3_thread_update MCP tool for thread metadata actions

  • Introduces ThreadMetadataMcpService and the t3_thread_update orchestrator MCP tool supporting four actions: rename, title regeneration, pull-request link, and pull-request unlink
  • Defines validated contracts in threadMetadataMcp.ts requiring action-specific fields, HTTP(S)-only PR URLs, bounded client request IDs, and non-empty titles up to 512 chars
  • Updates thread.metadata.update command handling in Orchestrator.ts to persist or clear a linked pull request field in the resulting event
  • Thread list and detail responses now include nullable linked pull request and title-regeneration state; determinstic command IDs enable idempotent client-request retries
  • Behavioral Change: OrchestratorMcpThreadListItem and OrchestratorMcpThreadDetail schemas in orchestratorMcp.ts gain new nullable fields; existing MCP consumers that validate strictly against these schemas must accept the added fields

Macroscope summarized aeabb89.


Note

Medium Risk
Introduces a new mutating MCP surface that dispatches durable orchestration commands and links external PR metadata; mistakes in scoping or validation could affect thread metadata across a project.

Overview
Adds t3_thread_update so provider agents can mutate thread metadata through the orchestrator MCP toolkit: rename, regenerate title, link pull request, and unlink pull request. Workspace/branch changes stay out of scope.

A new ThreadMetadataMcpService enforces orchestration capability, resolves the target thread in the calling project (defaulting to the caller), builds stable thread.metadata.update commands with clientRequestId idempotency, and returns committed title, titleRegeneration, and linkedPullRequest state. OrchestratorMcpService thread list/detail responses now surface linkedPullRequest (and in-flight title regeneration on read).

Contracts live in threadMetadataMcp.ts with action-specific validation (HTTP(S) PR URLs, title length, surrogate-safe idempotency keys). Docs, UI tool presentation, and integration/unit tests cover the new tool and read path.

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

@coderabbitai

coderabbitai Bot commented Aug 29, 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: 49ac51cb-2ccf-4931-b043-86d94725b410

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.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 29, 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: one finding in the new ThreadMetadataMcpService module. Everything else (namespace imports of effect/*, ThreadMetadataMcpService.layer used as a namespace member in McpHttpServer.ts, dependencies acquired via yield* in make, no ManagedRuntime/runPromise at the service boundary) matches the conventions.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/mcp/ThreadMetadataMcpService.ts Outdated
Comment thread apps/server/src/mcp/toolkits/orchestrator/tools.ts Outdated
@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

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

This comment will update automatically after the next completed run.

@juliusmarminge
juliusmarminge marked this pull request as ready for review August 29, 2026 22:44
@macroscopeapp

macroscopeapp Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR adds a new production MCP tool that lets orchestration-authorized agents mutate durable thread metadata, link pull requests, and trigger asynchronous title generation. Its expanded capability surface and downstream side effects are broader than a small isolated change.

No code changes detected at 1d3256b. Prior analysis still applies.

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

Comment thread docs/orchestration-v2/orchestrator-mcp-server.md Outdated
Comment thread apps/server/src/mcp/ThreadMetadataMcpService.ts
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-thread-metadata/update branch from a965fc4 to 13b1c0a Compare August 30, 2026 20:15
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-thread-metadata/update branch from 13b1c0a to aeabb89 Compare September 5, 2026 05:54
Base automatically changed from agents/mcp-thread-metadata/persistence to t3code/codex-turn-mapping September 6, 2026 02:14
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-thread-metadata/update branch from aeabb89 to 1d3256b Compare September 6, 2026 02:14
@juliusmarminge
juliusmarminge merged commit 26a48b0 into t3code/codex-turn-mapping Sep 6, 2026
23 checks passed
@juliusmarminge
juliusmarminge deleted the agents/mcp-thread-metadata/update branch September 6, 2026 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 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