Repository navigation
feat(mcp): route all tools to linked environments - #304
Conversation
|
What: PR #304 is ready for the required independent reviews at 75fb6b5. No deployment or restart is part of this PR. Source-owned remote launch attachments retain their existing refusal; destination-owned attachments can be uploaded and sent with the routed attachment tools. Caller-bound tools require contextThreadId on the destination. Direct full-access/default links gain environment-level operations within that grant, while narrowed links, linked descendants, foreign-thread contexts and onward forwarding remain refused. |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
|
What: Independent Sol review found two blocking defects at Verdict: changes required. Reviewed the full Issue #302 and PR #304 bodies, the cumulative diff from 1. P1: Spectrum forwarding escapes the peer's thread and onward-link fencesLocation: the new direct-peer exception, the now-routed Spectrum tool, and Spectrum shell creation. Trigger: call Even when the caller thread is link-owned, Required correction: keep Spectrum's destination caller within the authenticated link and retain that origin on the transcript and every Color. The full-access environment-mutation exception must not implicitly authorize unrelated caller selection or unmarked descendant creation. Prove this with the real Spectrum registration service and persisted shells, including a foreign caller refusal and refusal of an actual Color's onward forwarding. The current routing fixture mocks 2. P2: Forwarded
|
75fb6b5 to
298cbdc
Compare
|
What: PR #304 has a new proved candidate at Sol finding responses: Spectrum checks the destination caller's link and mode limits; transcript and Colors inherit linkOrigin, with registration guards retaining modes/origin across commit. The real SQL-backed registration test proves every persisted descendant retains its origin and actual PeerForwarding rejects its onward calls. A real-socket test refuses a caller from another link. HTML prepares on the destination and publishes that self-contained output in the source thread's attachment store, with a bounded prepared-document schema/service boundary. Real services, destination image bytes, both stores and the shared client reference parser prove the returned source attachment is readable, has one bootstrap and leaves no orphan page on the peer. Web, desktop and mobile keep their current local reference contract. At this exact candidate, 185 focused tests pass in 20 files; four optional real-browser cases skip. Targeted server/contracts typechecks, changed-file lint/format and fork stack ownership check pass. Lint has only the two existing registry callback warnings. No browser/live-machine checks, repo-wide local checks or restart. Earlier Grok round is still active on the old SHA; its eventual findings will be reconciled, never transferred as a verdict for this head. |
|
What: Independent Sol review requires changes at Verdict: changes required, with one P1 blocker. This fresh independent round reads the complete Issue #302 and PR #304 bodies, both prior Sol findings and the response, the cumulative 40-file diff from P1: Peer-created scheduled threads escape the link and onward-link fencesChanged entry point: the direct full-access exception in Trigger: a full-access/default agent in environment A calls
The resulting full-access agent has neither Required correction: retain authenticated link ownership in the durable scheduled-work state and every thread it creates, including later firing after persistence/restart, while preserving the full-access direct environment-management outcome. Review schedule rebinding and execution against that ownership as well. Add proof through real scheduled-task persistence and launch, then verify that the persisted thread cannot mutate an unrelated thread/environment or make an actual onward PeerForwarding call. An environment-mutation exception must not waive Prior findings adjudication
Coverage and proof limitsReviewed routing/access and relevant consumers for schedules; thread lifecycle, metadata, configuration, search and transfers; queues and pending requests; projects/worktrees/preferences/secrets; attachments; Issue/PR links; browser/preview/device/HTML; and Spectrum. Inspected same-link context credential lookup, expiry/revocation, capability intersection, mode ceilings/live-run checks, direct versus descendant fences, onward refusal, production image registration/decoding, destination upload origins, local metadata removal, wait chunking/run pinning and namespaced retry keys. No additional supported blocker was established in those paths. Inspected the supplied focused log showing 185 passed in 20 files, four skipped, the relevant test assertions, and the targeted typecheck/lint/format logs. These are reused implementation-run evidence, not tests executed by this reviewer. The schema-key test retains the original required fields while allowing compatible additions; schema descriptions and fork hook records repair their owners, without modifying CI/checker logic. Live GitHub CI is green on this head. CI and the focused mocks do not cover the scheduled-origin defect above. No duplicate tests, repo-wide local checks, live linked-machine/device/browser interaction, installation, server launch, restart or deployment occurred. The schedule finding is established by the reachable production source path, not a new runtime reproduction. Destination panel state and destination-local device launcher/config or preview recording paths remain destination resources. Driving or consuming those local files requires execution on that destination; this review does not impose implicit local file transfer. Screenshots cross as bytes and pending uploads identify their destination origin. Remote launch attachment refusal is retained; remote attachment sends use destination resources. Elon recordRequirements and who asked: User requested this independent exact-candidate review for #302/#304, full linked MCP reach retaining scopes/capabilities/modes/link ownership/live checks/no onward links, and a findings comment followed by Reviewer: gpt-6.1-sol, Codex harness in T3 Code, high reasoning effort. No Grok verdict is claimed for this candidate. |
|
What: Independent review of Why: Two reachable ownership breaks: So what: Fix both on the current PR head and get a new exact-head review. This status does not cover any other commit. I did not merge or change the branch. Reviewed commit: This commit is not an ancestor of the open PR head Required1. Top-level
|
298cbdc to
23cdfa1
Compare
|
What: PR #304 has a fresh proved candidate at All supported findings are corrected:
On this exact head: 396 focused tests pass in 31 files, four optional browser tests skipped. Targeted server/contracts typechecks pass. All 49 changed TypeScript files pass formatting/lint with only three pre-existing warnings (two registry callbacks and an unchanged optional-chaining expression in ThreadLaunchService.test). Fork ownership check passes 36 features. Rebased onto PR #309 and installed its lockfile/patch before current proof. No repo-wide local check, live-machine/browser/device interaction, version bump, memory write, restart or deployment. Requirements and who asked: User requested full linked MCP reach with original scopes and narrowing, faithful group proof, source task ownership, and exact-head Sol/Grok reviews plus CI before merge. |
|
What: Independent Sol review found no blocking defect at Verdict: pass, with no supported actionable blocker in the inspected scope. Reviewed the full Issue #302 and PR #304 bodies, the prior findings and current response, and the complete cumulative 53-file diff from main Prior findings adjudication
Inspected coverage and limitsTraced declarations and routing for schedules and durable execution; thread launch/create/fork/merge, lifecycle, configuration, metadata, search and transfers; queues and pending requests; projects, worktrees, preferences and secrets; attachments; Issue/PR links; browser/preview controls, devices, HTML and Spectrum. Checked relevant consumers and effects rather than relying solely on routing mocks. The context binding requires a same-link, nondeleted destination thread and an existing unexpired/revocable registry credential, checks its modes against the link ceiling, and intersects destination credential grants with source capabilities. Source routing overwrites transport capability metadata; destination declarations and mutation paths retain capability, live-run, ownership and mode checks. Direct full-access/default environment calls remain distinct from linked descendants, and PeerForwarding refuses onward links whenever caller origin exists. Also inspected local metadata stripping, source-owned delegation, remote launch attachment refusal, destination uploadOrigin, image bytes before presentation filtering, wait chunking/run pinning and namespaced retry keys. Forks inherit source origin; existing thread mutations do not rewrite unrelated ownership. Reused and inspected the supplied exact-candidate evidence: focused log 396 passed in 31 files, four optional browser cases skipped; server/contracts typecheck logs with no TypeScript errors; 49-file formatting result and three baseline lint warnings. Relevant new test assertions were read directly. Live GitHub CI is green on the exact head, including lint, typecheck, build, test/server/web and fork checks. These are implementation-run checks and CI, not tests executed by this reviewer. Transport/OAuth/schema/declaration tests are real; most per-group domain services are mocked. The additional persistence/launch, completion delivery and HTML storage tests cover the prior missing effects, but do not constitute live linked-machine or client verification. No duplicate tests, repo-wide local checks, browser/device interaction, live linked-machine use, installation, server launch/restart, deployment, implementation edits or merge occurred. PR #304 is linked to this review thread through MCP. This verdict states no supported blocker in the reviewed scope, not proof that every external runtime path is defect-free. Elon recordRequirements and who asked: User requested independent exact-head Sol review for #302/#304, every tool's linked reach with existing scopes/capabilities/modes/link ownership/live checks/no onward links, and findings followed by Reviewer: gpt-6.1-sol, Codex harness in T3 Code, high reasoning effort. Reviewed SHA: |
|
What: Independent review of Why: Routing declarations are not the fence. Same-link origin, source task records, Spectrum shells, and source HTML storage are. So what: Reviewed head Prior findings
CoverageTraced, not only declared: Proof limitsThe author reports 396 focused tests, targeted Elon recordRequirements and who asked: The user, 2026-10-14, asked for an independent high-effort review of PR 304 / Issue 302 at exact Deleted: Style notes, rerunning the focused suite, repo-wide checks, live machines, extra agents, and messaging the planner. Bottleneck: Ownership at the persisted effect (schedule row, source delegation record, Spectrum shells, source HTML file), not the routing field. Checked myself: Read routing, access, link origin, forwarding, session registry, Spectrum launch and registration, schedule SQL and checked replay, HTML prepare and publish, image and upload return, delegation record and launch, recovery wait, and fork copy at |
What: Every T3 MCP toolkit can target a linked environment while retaining its caller and link access limits.
Why: Existing peer forwarding covered only a small set of orchestration tools, leaving most capabilities local.
So what: Agents can use destination-owned services across machines after this PR passes both exact-head reviews and CI; the next normal build delivers it.
Closes #302. Continues #164 / PR #290. Extends the existing component, with no new transport or design round.
The shared MCP declaration boundary routes tools after their existing access check. Destination declarations check them again, with mode narrowing and source/destination capability intersection. Caller-bound tools use
contextThreadId, restricted to this link's live destination credential. Full-access/default direct links can manage environment resources; narrower links, linked descendants, foreign thread selection and onward links remain fenced.Delegation keeps its source task record and completion wake: top-level
environmentIdaliases the existingtarget.environmentIdpath, rejecting conflicting destinations. Scheduled tasks store immutable link origin, carry it into ordinary/checked launches and crash replays, and refuse foreign binding or execution. Existing UI form edits cannot erase ownership; the nullable fork column preserves legacy tasks without taking an upstream migration number.Spectrum registration keeps the caller's link origin on its transcript and every Color. Image results cross as bytes before presentation filtering. Attachment preparation supplies the destination upload origin; remote launch attachments retain their existing refusal, while destination uploads can be sent through the attachment tools. HTML prepares local images on the destination and stores its self-contained output in the source thread, preserving the attachment reference already consumed by web, desktop and mobile.
Upstream first: inspected the complete later peer PR diffs. pingdotgg/t3code #16684 remains open and has the same limited forwarding already ported; #17129 concerns link setup. No later merged implementation forwards the remaining groups. Source links and the per-tool table are in #302. File overlap is recorded on #166.
Proof
At
23cdfa11a29aabf88c564f4114d1942c64774231, rebased onto main366f2fff6f25f47c14ca86163d8ee8e4dd6c0961:npx -y pnpm@11.10.0 installcompleted in the exclusive worktree.npx -y pnpm@11.10.0 exec vp test run <files>: 396 passed in 31 files, four optional real-browser tests skipped. Scope: PeerToolRouting, PeerForwarding, PeerLinks; McpToolAccess and its race test, McpSessionRegistry, McpHttpServer, linkOrigin; toolkit core and thread/project/environment/preview/previewControls/device/pullRequests handler tests; Spectrum Launch integration; HtmlRender; orchestrator and preview tool schema tests; RemoteDelegation; OrchestratorMcpService/activity/toolkit integration; real ThreadLaunch; scheduled service/schedule/webhook; checked engine/integration; legacy scheduled-origin schema migration.tsc --noEmit -p apps/server/tsconfig.jsonand-p packages/contracts/tsconfig.jsonpassed.No real linked-machine, device or browser interaction was performed. No repo-wide local check, version bump, deployment or restart. Website impact: none, because this changes server MCP reach and does not change marketing or hosted client content.
Elon record
Requirements and who asked: User, 2026-10-14: full linked MCP reach, existing scopes and link narrowing, per-tool inventory, upstream-first, focused proof, exact-head Sol/Grok reviews and authorized merge.
Deleted: New transport, new design round, arbitrary file copying, onward link chaining, version bumps, repo-wide local checks and deployment.
Bottleneck: Routing must preserve domain ownership as well as access: source-owned delegation, durable scheduled descendants, authenticated destination context and client-consumable artifacts.
Checked myself: Read the upstream peer diffs and current handlers/access/transport; executed focused OAuth/peer tests, real Spectrum persistence and HTML attachment consumption, scoped typechecks/lint and fork ownership validation.
Implementation: gpt-6.1-sol, Codex harness in T3 Code. Independent reviewers: gpt-6.1-sol and grok-4.7, each required to publish findings followed by success on this PR's exact final head.