Skip to content

feat(mcp): manage queued thread work - #8699

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

feat(mcp): manage queued thread work#8699
juliusmarminge wants to merge 12 commits into
t3code/codex-turn-mappingfrom
agents/mcp-queue-inputs/controls

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Aug 29, 2026

Copy link
Copy Markdown
Member

Problem

Agents could enqueue work but could not inspect or safely manage queued runs through MCP.

Change

  • Add bounded t3_queue_list and t3_queue_read tools.
  • Add receipt-backed edit, reorder, cancel, and promote-to-steer operations.
  • Preserve omitted attachment lists, while an explicit empty list clears attachments.
  • Enforce caller runtime and interaction ceilings for prompt-changing operations inside the serialized V2 decision.

Behavior

Fresh mutations validate current project scope and queued-run state. Accepted retries return the original durable result before mutable attachment or lifecycle checks. Reorder results distinguish a replayed request from a newly applied destination, and list previews remain bounded without splitting Unicode surrogate pairs.

Validation

  • 87 focused queue service, MCP/V2 integration, Claude capability, and contract tests.
  • Scoped @t3tools/contracts 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 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: 28d9d494-7e7b-46ba-b3c9-480a53c5d667

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 29, 2026 23:37
@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 29, 2026

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

One convention violation found in the new Effect service module. See inline comment.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/mcp/QueueMcpService.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 fd15a16.

This comment will update automatically after the next completed run.

@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 high 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 ebc47f0. Configure here.

Comment thread packages/contracts/src/queueMcp.ts
@macroscopeapp

macroscopeapp Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR adds six production MCP tools that let agents inspect and mutate queued work, including editing prompts, reordering or cancelling runs, and promoting queued messages into active steering. It also changes shared orchestration policy, locking, and durable replay behavior, creating a broad runtime surface that merits human review.

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

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

Comment thread apps/server/src/mcp/QueueMcpService.ts
Comment thread docs/user/composer.md Outdated
Comment thread apps/server/src/mcp/QueueMcpService.ts Outdated
@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

@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 queued-work MCP service, contracts, toolkit, and the orchestrator/thread-management additions against the Effect service conventions. The service definition itself now follows the canonical shape (inline Context.Service interface, real make, exported layer). One small deviation remains in the new orchestrator surface.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/orchestration-v2/Orchestrator.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.

UI Consistency: environment routing regression in a shared renderer

One concrete violation of the environment-routing rule, plus one dead global CSS rule introduced by this change. Everything else I checked in the web UI scope (MenuPopup width defaulting contract, @variant dark/light usage, the virtualized/topbar scroll-fade masks preserving the scrollbar lane, and the thread details panel rows composing Button/Select/Tooltip primitives) looked consistent.

  • apps/web/src/components/ChatMarkdown.tsx — the shared markdown renderer now resolves its server config and "open in editor" RPC from the globally active environment instead of explicit scope.
  • apps/web/src/components/pullRequest/PullRequestMarkdown.tsx — the pull request panel no longer passes an explicit environment to that renderer (environmentId is now an accepted-but-unused prop).
  • apps/web/src/index.css — the new .surface-subheader rule has no consumers; the four call sites use the data-surface-subheader attribute instead.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/index.css
Comment thread apps/web/src/components/pullRequest/PullRequestMarkdown.tsx Outdated
Comment thread apps/web/src/components/ChatMarkdown.tsx Outdated
@juliusmarminge
juliusmarminge changed the base branch from t3code/codex-turn-mapping to agents/mcp-controls/base-490318a August 30, 2026 00:51

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

One finding on the new QueueMcpService error translation. Everything else (inline Context.Service interface, make/layer shape, namespace import in McpHttpServer, Foo["Service"] typing in Orchestrator/ThreadManagementService, toolkit wiring) matches the existing worktree/orchestrator MCP conventions.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/mcp/QueueMcpService.ts
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-queue-inputs/controls branch from e9da34d to b0812c2 Compare August 30, 2026 17:26
@juliusmarminge
juliusmarminge changed the base branch from agents/mcp-controls/base-490318a to t3code/codex-turn-mapping August 30, 2026 17:26
@github-actions github-actions Bot added the 📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. label Aug 30, 2026
@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/controls branch from b0812c2 to 6d4c97d Compare August 30, 2026 20:11
@github-actions github-actions Bot removed the 📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. label Aug 30, 2026
Comment thread apps/server/src/orchestration-v2/Orchestrator.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.

One finding on the new queue MCP service: the dispatch-error translation boundary discriminates statically known tagged failures by duck-typing an unknown value instead of the declared OrchestratorV2Error channel.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/mcp/QueueMcpService.ts Outdated
@juliusmarminge
juliusmarminge force-pushed the t3code/codex-turn-mapping branch 6 times, most recently from f2e4a0d to 3ed8c4d Compare September 5, 2026 00:45
@juliusmarminge
juliusmarminge force-pushed the t3code/codex-turn-mapping branch 2 times, most recently from b82facd to 2ac9bfe Compare September 5, 2026 04:56
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-queue-inputs/controls branch from e2f3c0f to 038581a Compare September 5, 2026 05:54
Comment thread apps/server/src/mcp/QueueMcpService.ts
Comment thread apps/server/src/mcp/QueueMcpService.ts
Comment thread apps/server/src/mcp/QueueMcpService.ts Outdated
@juliusmarminge

Copy link
Copy Markdown
Member Author

Superseded as the active MCP proposal by #10555 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. Output text is bounded by Unicode code points. Paging is a live offset. Queue ordering, dispatch and replay semantics remain in the existing services.

Closing this mixed proposal without merging. The remote branch agents/mcp-queue-inputs/controls and exact head fd15a16174a8c7f2de6bb735d652c8d172ce9e96 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:XXL 1,000+ 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