Skip to content

feat(mcp): update thread metadata - #8690

Open
juliusmarminge wants to merge 5 commits into
agents/mcp-thread-metadata/persistencefrom
agents/mcp-thread-metadata/update
Open

feat(mcp): update thread metadata#8690
juliusmarminge wants to merge 5 commits into
agents/mcp-thread-metadata/persistencefrom
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 to update thread metadata

  • Adds ThreadMetadataMcpService to handle thread metadata mutations (rename, regenerate title, link/unlink PR) and dispatch them via ThreadManagementService.
  • Registers the t3_thread_update tool in the orchestrator toolkit.
  • Adds input and output schemas in threadMetadataMcp.ts with validation for HTTP(S) URLs and title length limits.
  • Adds linkedPullRequest and titleRegeneration fields to the OrchestratorMcpThreadListItem and OrchestratorMcpThreadDetail schemas.
  • Behavioral Change: Thread list and detail responses now include linkedPullRequest and titleRegeneration fields.

Macroscope summarized 13b1c0a.


Note

Medium Risk
Introduces new mutable MCP surface on orchestration threads (titles and PR links) with project scoping and input validation, but incorrect authorization or command handling could affect durable thread metadata across clients.

Overview
Adds t3_thread_update so provider agents can mutate thread metadata through the app-owned orchestrator MCP toolkit: rename (with title), regenerate_title, link_pull_request (repository, number, HTTP(S) URL), and unlink_pull_request. Omitting threadId targets the calling thread; updates stay within the caller’s project. Branch and workspace changes are explicitly out of scope.

A dedicated ThreadMetadataMcpService enforces orchestration capability checks, maps actions to durable thread.metadata.update commands via ThreadManagementService, and returns committed state (title, titleRegeneration, linkedPullRequest, command id, sequence). clientRequestId stabilizes command ids for idempotent retries.

t3_thread_list and t3_thread_read responses now surface linkedPullRequest; thread detail also includes titleRegeneration. Contracts, toolkit schema validation, integration tests, docs, and UI tool presentation are updated for the new tool and fields.

Reviewed by Cursor Bugbot for commit 13b1c0a. 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 13b1c0a.

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 adds a new MCP mutation tool that can rename threads, manage pull-request links, and trigger asynchronous title regeneration through durable orchestration. Its production wiring and multi-action behavior go beyond a small bounded additive change, so the new capability warrants human review.

No code changes detected at 13b1c0a. 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
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