Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(mcp): update thread metadata #8690

Mergedjuliusmarmingemerged 5 commits intot3code/codex-turn-mapping fromrefs/pull/8690/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

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](https://cursor.com/bugbot) for commit aeabb8905cb9f78653fc8841f269242411a059ed. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      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.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. 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
    4. github-actions[bot](GitHub profile, opens in a new tab)commented

      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.

    5. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      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](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    6. juliusmarminge merged this26a48b0

    7. juliusmarminge closed this

Sign in to join this conversation.