feat(mcp): update thread metadata #8690
Mergedjuliusmarmingemerged 5 commits into
t3code/codex-turn-mapping fromrefs/pull/8690/headmerged by juliusmarminge View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- apps/server/src/mcp/ThreadMetadataMcpService.ts lines 23 to 33OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +13,21 @@13+import * as DateTime from "effect/DateTime";14+import * as Effect from "effect/Effect";15+import * as Layer from "effect/Layer";16+17+import {18+ ThreadManagementError,19+ ThreadManagementService,20+} from "../orchestration-v2/ThreadManagementService.ts";21+import type { McpInvocationScope } from "./McpInvocationContext.ts";22+23+export interface ThreadMetadataMcpServiceShape {24+ readonly update: (25+ scope: McpInvocationScope,26+ input: ThreadMetadataMcpUpdateInput,27+ ) => Effect.Effect<ThreadMetadataMcpUpdateResult, OrchestratorMcpFailure>;28+}29+30+export class ThreadMetadataMcpService extends Context.Service<31+ ThreadMetadataMcpService,32+ ThreadMetadataMcpServiceShape33+>()("t3/mcp/ThreadMetadataMcpService") {}
- apps/server/src/mcp/toolkits/orchestrator/tools.ts lines 211 to 211OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -190,3 +197,15 @@190197 .annotate(Tool.Destructive, false)191198 .annotate(Tool.Idempotent, true);192199200+export const ThreadUpdateTool = Tool.make("t3_thread_update", {201+ description:202+ "Update metadata for a thread in the calling project. Omit threadId to update this thread. Use action='rename' with title, action='regenerate_title' with no extra field, action='link_pull_request' with pullRequest, or action='unlink_pull_request'. Workspace and branch changes are intentionally not supported. clientRequestId makes retries idempotent.",203+ parameters: ThreadMetadataMcpUpdateInput,204+ success: ThreadMetadataMcpUpdateResult,205+ failure: OrchestratorMcpFailure,206+ failureMode: "return",207+ dependencies: threadMetadataDependencies,208+})209+ .annotate(Tool.Title, "Update T3 thread metadata")210+ .annotate(Tool.Destructive, true)211+ .annotate(Tool.Idempotent, true);
- docs/orchestration-v2/orchestrator-mcp-server.md lines 393 to 393OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -376,3 +391,3 @@376391 ## Code Ownership377392378393 Shared schemas: `packages/contracts/src/orchestratorMcp.ts`apps/server/src/mcp/ThreadMetadataMcpService.ts line 166Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +133,21 @@133+}134+135+const make = Effect.gen(function* () {136+ const crypto = yield* Crypto.Crypto;137+ const threadManagement = yield* ThreadManagementService;138+139+ const update = Effect.fn("ThreadMetadataMcpService.update")(function* (140+ scope: McpInvocationScope,141+ input: ThreadMetadataMcpUpdateInput,142+ ) {143+ if (!scope.capabilities.has("orchestration")) {144+ return yield* failure(145+ "capability_denied",146+ "This MCP credential does not grant orchestration capabilities.",147+ );148+ }149+150+ const parent = yield* threadManagement151+ .getThreadProjection(scope.threadId)152+ .pipe(153+ Effect.mapError((error) =>
juliusmarminge merged this26a48b0
juliusmarminge closed this
Sign in to join this conversation.
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:
49ac51cb-2ccf-4931-b043-86d94725b410You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
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.