Skip to content

feat(mcp): expose thread organization commands - #10554

Merged
juliusmarminge merged 1 commit into
agents/mcp-shared/attachment-intakefrom
agents/mcp-thin/thread-organization
Sep 7, 2026
Merged

feat(mcp): expose thread organization commands#10554
juliusmarminge merged 1 commit into
agents/mcp-shared/attachment-intakefrom
agents/mcp-thin/thread-organization

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Sep 7, 2026

Copy link
Copy Markdown
Member

Part 4/16 of the shared-core and MCP stack. Based on #10580. Next: #10555.

Agents cannot invoke the existing pin, snooze, settle, archive and unread commands through MCP. This adds one scoped tool that dispatches those commands through ThreadManagementService.

This bottom layer also adds the shared caller/project/mode checks, fixed public errors and core MCP tests reused above. No lifecycle or command-service implementation changes. Deferred organization is not included.

MCP-only rebuild of #8676, preserving attribution to Julius Marminge's original work. Original branches remain available for separate service follow-ups.

Validation: The composed stack passes 94 tests across 12 focused files, including shared core MCP and real MCP/V2 integration, attachment intake, project RPC/service contracts, and client model command selection. Server/contracts/shared/client-runtime typechecks and targeted format/lint/diff checks pass. New behavior coverage lives with the shared operation; no per-tool mock suite was added. Current-head CI is shown below.

Layer size: 8 files, +308/-3. No domain-service production implementation or documentation files change in this MCP layer.

Prepared with Codex in the OpenAI agent runtime.

Note

Add t3_thread_organize MCP tool to dispatch thread organization commands

  • Adds the t3_thread_organize tool schema and toolkit, then registers live handlers that map pin, unpin, snooze, unsnooze, settle, unsettle, archive, unarchive, and mark-unread actions to orchestration commands
  • Introduces thread-access helpers in threadAccess.ts: caller resolution requires the orchestration capability, thread lookup is scoped to the caller's project, and the active-owner guard rejects archived callers or provider mismatches with parent_not_active\n- Writable-thread validation fails when the target thread's runtime or interaction mode would broaden the caller's mode; missing snoozedUntil returns invalid_request and dispatch failures return the fixed public orchestration_error payload
  • Adds tests for schema uniqueness across toolkits, capability denial before the management service is used, storage-failure boundary behavior, and integration pin/unpin plus cross-project thread_not_found
  • Refactors turn-request launch error handling in ws.ts into tag-specific mappers for AttachmentClaimError, ThreadLaunchError, and ServerRuntimeStartupError
  • Risk: mutation flows now enforce the active-owner guard in assertLiveCaller; any caller lacking an active run or owned by a different provider instance will receive parent_not_active where they previously may have succeeded

Macroscope summarized c03cefc.

@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 Sep 7, 2026
@juliusmarminge juliusmarminge changed the title feat(mcp): expose existing thread organization commands feat(mcp): expose thread organization commands Sep 7, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR adds and production-registers a new destructive MCP tool that can mutate thread lifecycle and organization state through multiple commands. The access checks and tests reduce risk, but the new user-facing capability and persisted side effects warrant human review.

No code changes detected at c03cefc. Prior analysis still applies.

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

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

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

This comment will update automatically after the next completed run.

@juliusmarminge
juliusmarminge force-pushed the agents/mcp-thin/thread-organization branch 2 times, most recently from f2c39f3 to 6613b5c Compare September 7, 2026 20:40
@juliusmarminge
juliusmarminge changed the base branch from t3code/codex-turn-mapping to agents/mcp-shared/attachment-intake September 7, 2026 20:40
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-thin/thread-organization branch from 6613b5c to c6f5c97 Compare September 7, 2026 20:48
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-thin/thread-organization branch from c6f5c97 to c03cefc Compare September 7, 2026 20:55
@juliusmarminge
juliusmarminge merged commit df3ebef into t3code/codex-turn-mapping Sep 7, 2026
35 of 45 checks passed
@juliusmarminge
juliusmarminge deleted the agents/mcp-thin/thread-organization branch September 7, 2026 21:34
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