Skip to content

feat(mcp): organize thread state - #8676

Closed
juliusmarminge wants to merge 7 commits into
t3code/codex-turn-mappingfrom
agents/mcp-thread-state/organization
Closed

feat(mcp): organize thread state#8676
juliusmarminge wants to merge 7 commits into
t3code/codex-turn-mappingfrom
agents/mcp-thread-state/organization

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Aug 29, 2026

Copy link
Copy Markdown
Member

Agents can inspect thread run state through MCP, but they cannot see or change the organization state users manage in the sidebar.

This change adds shell-backed organization fields and filters to thread list/read, plus typed tools for pinning, snoozing, settling, archiving, read state, and deletion. Mutations use the existing serialized V2 commands and return durable resulting state. Archived discovery stays on the shell snapshot path without loading transcripts.

Behavior remains current-project scoped. The V2 decider owns lifecycle rules, and MCP refuses to archive a thread with a pending approval or user-input request. The current V2 settlement behavior, including snooze wake-up ordering, is preserved.

Focused validation:

  • 51 focused tests across contracts, MCP service/toolkit, runtime wiring, presentation, and ThreadSettlementService
  • vp run --filter t3 typecheck
  • vp run --filter @t3tools/contracts typecheck
  • vp run --filter @t3tools/shared typecheck
  • Targeted vp lint, vp fmt --check, and git diff --check

Review base: t3code/codex-turn-mapping at 415ed0f73b97f1655b6282492f81d0b2bba3a9cc. Native stack: #8676#8683.

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

Note

Add t3_thread_organize and t3_thread_delete MCP tools and extend thread listing with organization state

  • Adds MCP tools for pin, snooze, settle, archive, reorder, and mark-read/unread actions on threads, supporting single or batched requests (max 20 items) with per-item success/failure outcomes
  • Adds t3_thread_delete with idempotent handling and calling-project scope enforcement
  • Extends t3_thread_list and t3_thread_read responses with branch, workspace, pin, settlement, snooze, archive, and read-state fields; read state is computed from the latest run completion watermark without loading transcripts
  • Adds a dispatch guard in makeOrchestrator that rejects constrained thread.archive commands when pending runtime requests exist, leaving archive state and request status unchanged
  • Behavioral Change: listProjectThreads in ThreadManagementService.ts gains an optional includeArchived parameter; default listing still returns active shells only. Archive commands carrying requireNoPendingRuntimeRequests will now raise OrchestratorDispatchError when pending approval or user-input runtime requests exist.

Macroscope summarized 35dfd51.

@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: 46576861-3c0d-4774-aad4-500d34de2b1d

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
Comment thread apps/server/src/mcp/OrchestratorMcpService.ts
Comment thread packages/contracts/src/orchestratorMcp.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 35dfd51.

This comment will update automatically after the next completed run.

Comment thread docs/orchestration-v2/orchestrator-mcp-server.md Outdated
@juliusmarminge
juliusmarminge marked this pull request as ready for review August 29, 2026 21:46
@macroscopeapp

macroscopeapp Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — The PR adds agent-facing thread organization and permanent deletion, including operations that can alter durable state, archive work, cancel active activity, or remove threads. It also expands the shared MCP contract and orchestration runtime, making this broader than a low-risk metadata or documentation change.

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

@juliusmarminge
juliusmarminge changed the base branch from t3code/codex-turn-mapping to agents/mcp-controls/base-490318a August 30, 2026 00:50
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-thread-state/organization branch from 48ed246 to 29d7c1e Compare August 30, 2026 17:23
@juliusmarminge
juliusmarminge changed the base branch from agents/mcp-controls/base-490318a to t3code/codex-turn-mapping August 30, 2026 17:23
@github-actions github-actions Bot added size:XXL 1,000+ changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels Aug 30, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Macroscope has since reviewed this pull request. An earlier review was skipped by a cost limit; a review has now completed, so that notice no longer applies.

@juliusmarminge
juliusmarminge force-pushed the agents/mcp-thread-state/organization branch from 29d7c1e to 938895b Compare August 30, 2026 20:14
@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:XXL 1,000+ changed lines (additions + deletions). labels Aug 30, 2026
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-thread-state/organization branch from 938895b to ecd8cc0 Compare September 5, 2026 06:04
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-thread-state/organization branch from ff5f07a to 35dfd51 Compare September 7, 2026 18:32
@cursor

cursor Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@juliusmarminge

Copy link
Copy Markdown
Member Author

Superseded as the active MCP proposal by #10554 in the rebuilt MCP stack, following the maintainer request to review thin service wrappers separately from service hardening.

This is not a full feature-parity replacement. 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.

Closing this mixed proposal without merging. The remote branch agents/mcp-thread-state/organization and exact head 35dfd51a7db2f9d98233becc64909798ad848e89 are retained so the service changes can be extracted for separate review later.

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