feat(mcp): answer delegated user-input requests - #8716
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Thread transfer impact
This comment will update automatically after the next completed run. |
There was a problem hiding this comment.
Reviewed the new PendingRequestMcpService and its call sites against the Effect service conventions. Service definition (inline Context.Service interface, make acquiring ThreadManagementService/Crypto from the environment, export const layer), namespace imports, toolkit wiring, and Foo["Service"] usage all look right. Two findings on the error-translation helpers.
Posted via Macroscope — Effect Service Conventions
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Bugbot Autofix is ON, but a cloud agent failed to start.
Reviewed by Cursor Bugbot for commit f757189. Configure here.
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR adds three production MCP tools and a new delegated-response workflow, including durable command replay and shared orchestration locking and policy-ceiling changes. The new user-facing capability and cross-component runtime impact exceed a small isolated change and warrant human review. You can add or adjust custom eligibility rules. Learn more. |
There was a problem hiding this comment.
One finding: the child-projection failure classifier discards a statically known tagged error union. The previously flagged dispatchFailure typing is now resolved.
Posted via Macroscope — Effect Service Conventions

Problem
App-owned delegated children can pause for structured user input, but their parent agent has no scoped MCP read or response path. A generic runtime-request tool would also risk exposing approval decisions or unrelated provider requests.
Change
t3_pending_request_listand exactt3_pending_request_readtools for structured user-input questions on direct app-owned delegated children.t3_pending_request_respond, which accepts answers keyed by every question ID and dispatches the existing V2runtime-request.respondcommand with answers only.Behavior
Read paths are non-mutating and never list approval requests. Stable identity cursors survive resolved prior pages and task reordering; each page caps both returned requests and child projections inspected. Oversized provider question payloads remain discoverable with exact request IDs but are explicitly unavailable and never partially answerable. Respond supports text, numeric, boolean, and bounded multiple-choice answers while rejecting provider-native or unrelated children, non-user-input kinds, stale requests, ended provider sessions, incomplete answer maps, oversized payloads, and mode escalation. Accepted retries reload durable state and return the original receipt without invoking the provider twice.
Validation
tools/listroot-object schemas and annotations; Claude read-only allowlist parity.Dependency
Standalone sibling on immutable base
agents/mcp-controls/base-490318aat490318afa505d3d033295eca12d7e62b4b922725; independent of project, queue, attachment, and conversation stacks. A one-PR standalone has no native GitHub stack object.Implemented by GPT-5.6-Sol via Codex in T3 Code.
Note
Add
PendingRequestMcpServiceto answer delegated user-input requestsPendingRequestMcpServiceexposinglist,read, andrespondvia three new MCP tools registered in McpHttpServer.ts;respondis idempotent, replays accepted receipts without re-dispatch, and applies the caller's runtime/interaction mode ceilings through a new optionalpolicyCeilingonruntime-request.respond.getCommandReceiptandenforceRuntimeRequestPolicyCeilingin Orchestrator.ts; inline mode ranking inOrchestratorMcpServiceis replaced by shared helpers in McpModeCeilings.ts.dispatchLockKeysnow locks both the targetthreadIdandcallerThreadIdwhenpolicyCeilingis present onruntime-request.respond, altering lock scope and acquisition for that dispatch path.Macroscope summarized 88e4840.
Note
High Risk
Touches orchestration dispatch, cross-thread locking, and permission ceilings on runtime-request responses—security-sensitive paths where incorrect enforcement could allow privilege escalation or unauthorized answers on child threads.
Overview
Adds a pending-request MCP toolkit so parent agents can discover and answer structured user-input questions on direct app-owned delegated children, without exposing approval flows or unrelated threads.
t3_pending_request_list,t3_pending_request_read, andt3_pending_request_respondare wired throughPendingRequestMcpService, registered on the HTTP MCP server, and included in orchestrator capability discovery (delegatedUserInputRequests). List/read are bounded (cursor pagination, capped child projection scans, oversized payloads markedtoo_largeand non-answerable). Respond dispatches V2runtime-request.respondwith answers only, stableclientRequestId/ command receipts, and accepted replay without double provider calls.Orchestration hardening:
runtime-request.respondgains optionalpolicyCeiling; the orchestrator enforces caller ownership, project scope, and runtime/interaction mode ceilings at commit time, and locks both caller and child threads when a ceiling is present. SharedMcpModeCeilingsreplaces duplicated rank checks in orchestrator MCP code.getCommandReceiptand dispatchreplayedare exposed through thread management for idempotent respond paths.Contracts, user/docs, Claude read-only allowlist (list/read), and integration/service tests cover the new surface.
Reviewed by Cursor Bugbot for commit 88e4840. Bugbot is set up for automated code reviews on this repo. Configure here.