Skip to content

feat(mcp): support thread attachments - #8700

Closed
juliusmarminge wants to merge 13 commits into
t3code/codex-turn-mappingfrom
agents/mcp-queue-inputs/attachments
Closed

feat(mcp): support thread attachments#8700
juliusmarminge wants to merge 13 commits into
t3code/codex-turn-mappingfrom
agents/mcp-queue-inputs/attachments

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Aug 30, 2026

Copy link
Copy Markdown
Member

Problem

MCP thread creation and send paths discarded attachments even though V2 already supports thread-scoped attachment claims.

Change

  • Add a signed pending-upload preparation tool and bounded ready-to-send attachment references.
  • Accept attachment references on thread creation and send without embedding file bytes in MCP results.
  • Reuse the existing attachment store, claim, provider capability, and V2 dispatch paths.
  • Recover accepted start/send receipts before mutable upload checks and retain claims on accepted or uncertain outcomes.

Behavior

Uploads use the existing POST route and bearer URL. New operations validate ownership, MIME support, and provider capability before creating a thread. Accepted retries return the original message and run identity after the pending upload disappears, while unused replay copies are cleaned up. OpenCode keeps path fallback behavior and Antigravity accepts image attachments only.

Validation

  • 63 focused attachment, MCP, ThreadLaunch, ThreadManagement, receipt-replay, contract, and presentation tests.
  • Scoped @t3tools/contracts, @t3tools/shared, and t3 typechecks.
  • Formatting and type-aware lint for all changed files.

Base

Standalone PR on t3code/codex-turn-mapping at 415ed0f73b97f1655b6282492f81d0b2bba3a9cc.

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

@coderabbitai

coderabbitai Bot commented Aug 30, 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: 7c62e49a-4968-46bc-a1ba-91b5d2c332f8

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.

@juliusmarminge
juliusmarminge marked this pull request as ready for review August 30, 2026 00:00
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XL 500-999 changed lines (additions + deletions). labels Aug 30, 2026
@github-actions

github-actions Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

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

This comment will update automatically after the next completed run.

Comment thread docs/orchestration-v2/orchestrator-mcp-server.md
Comment thread apps/server/src/orchestration-v2/Orchestrator.ts
Comment thread apps/server/src/mcp/OrchestratorMcpService.ts Outdated
Comment thread apps/server/src/mcp/AttachmentMcpService.ts Outdated
Comment thread apps/server/src/mcp/OrchestratorMcpService.ts Outdated
Comment thread apps/server/src/mcp/OrchestratorMcpService.ts
@macroscopeapp

macroscopeapp Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR adds a substantial production MCP attachment workflow spanning upload authorization, filesystem claims, orchestration retries, contracts, and provider adapters. An unresolved provider-delivery concern and newly added static-analysis suppression directives make human review necessary.

No code changes detected at 6991ca7. Prior analysis still applies.

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

@juliusmarminge
juliusmarminge force-pushed the t3code/codex-turn-mapping branch from 490318a to 373612e Compare August 30, 2026 00:13
@github-actions github-actions Bot added size:XXL 1,000+ changed lines (additions + deletions). and removed size:XL 500-999 changed lines (additions + deletions). labels Aug 30, 2026
Comment thread apps/server/src/orchestration-v2/Orchestrator.ts
Comment thread apps/server/src/mcp/OrchestratorMcpService.ts Outdated

@cursor cursor 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.

Stale Bugbot comment from a previous run.

Comment thread apps/server/src/mcp/OrchestratorMcpService.ts Outdated
Comment thread apps/server/src/mcp/OrchestratorMcpService.ts

@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.

UI consistency review

One concrete regression found: the shared markdown renderer now resolves its environment-scoped actions from the globally active environment instead of explicit scope.

Everything else in the changed web UI (panel/toolbar displayMode variants, ThreadDetailsPanel shared style constants, PopoverPopup positioner props) stays within the shared primitive contracts, and no apps/web/src CSS changed in this PR.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/ChatMarkdown.tsx Outdated
Comment thread apps/web/src/components/pullRequest/PullRequestMarkdown.tsx Outdated

@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.

Reviewed the new/changed Effect service code in this PR (AttachmentMcpService, the attachment toolkit, OrchestratorMcpService, ThreadManagementService, Orchestrator). One convention deviation found; everything else (namespace imports, inline Context.Service interface, environment-based dependency acquisition, structured Schema.TaggedErrorClass failures with derived messages and preserved cause) matches the conventions.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/mcp/AttachmentMcpService.ts Outdated
Comment thread apps/server/src/orchestration-v2/Adapters/OpenCodeAdapterV2.ts
Comment thread apps/server/src/orchestration-v2/Adapters/OpenCodeAdapterV2.ts
Comment thread apps/server/src/orchestration-v2/Adapters/OpenCodeAdapterV2.ts
@juliusmarminge
juliusmarminge changed the base branch from t3code/codex-turn-mapping to agents/mcp-controls/base-490318a August 30, 2026 00:51
@github-actions github-actions Bot added size:XL 500-999 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-queue-inputs/attachments branch from fae898d to 46e474c Compare August 30, 2026 17:15
@juliusmarminge
juliusmarminge changed the base branch from agents/mcp-controls/base-490318a to t3code/codex-turn-mapping August 30, 2026 17:15
Comment thread packages/contracts/src/attachmentMcp.ts Outdated

@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 review: one import-convention deviation in the new MCP attachment test. Everything else (new AttachmentMcpService tag/make/layer shape, environment-based dependency acquisition, and the new ThreadManagementPostDispatchProjectionError structural error with derived message and preserved cause) matches the repository conventions.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/mcp/OrchestratorMcpAttachments.test.ts Outdated

@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 review: one finding on the new OrchestratorV2Shape.getCommandReceipt signature.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/orchestration-v2/Orchestrator.ts Outdated
@juliusmarminge
juliusmarminge force-pushed the t3code/codex-turn-mapping branch from c01ff20 to 9d2539a Compare August 30, 2026 19:57
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-queue-inputs/attachments branch from bfc31cd to f1d2112 Compare August 30, 2026 20:12
Comment thread apps/server/src/mcp/AttachmentMcpService.ts

@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 review: one finding on the new transformEventSink type signatures in the replay harness.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/orchestration-v2/testkit/ProviderReplayHarness.ts Outdated
@juliusmarminge
juliusmarminge force-pushed the t3code/codex-turn-mapping branch from a6e0049 to 50a57b6 Compare September 1, 2026 05:36
@juliusmarminge
juliusmarminge force-pushed the t3code/codex-turn-mapping branch 7 times, most recently from b82facd to 2ac9bfe Compare September 5, 2026 04:56
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-queue-inputs/attachments branch from 31682e6 to da38dd1 Compare September 5, 2026 06:02

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON, but a cloud agent failed to start.

Reviewed by Cursor Bugbot for commit da38dd1. Configure here.

Comment thread apps/server/src/mcp/OrchestratorMcpService.ts
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-queue-inputs/attachments branch from da38dd1 to 6991ca7 Compare September 7, 2026 18:27
@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 #10564 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. t3_thread_send remains unchanged. The new t3_thread_send_attachments checks target ownership and permission ceilings. Each call is a new message; claimed files are retained when dispatch outcome is uncertain. Provider support stays in adapters, and no keyed replay protocol is added.

Closing this mixed proposal without merging. The remote branch agents/mcp-queue-inputs/attachments and exact head 6991ca726981ad8a608484beffd0dd76c9bef020 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:XL 500-999 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