Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(server): /mcp narrows a client's modes from T3-Mode-Limit #16653

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/16653/headmerged by juliusmarminge View on GitHub

Showing 5 changed files with 180 additions and 1 deletion (loading 3).

x
0 of 5 viewed, 5 left
146 additions and 0 deletionsapps/server/src/mcp/McpHttpServer.test.tsModified
View file
@@ -1,5 +1,6 @@
import * as Orchestrator from "../orchestration-v2/Orchestrator.ts";
import * as ProjectionStore from "../orchestration-v2/ProjectionStore.ts";
+import * as ThreadManagementService from "../orchestration-v2/ThreadManagementService.ts";
import { expect, it } from "@effect/vitest";
import { NodeHttpServer } from "@effect/platform-node";
import * as NodeServices from "@effect/platform-node/NodeServices";
@@ -8,6 +9,8 @@
OrchestratorMcpFailure,
PreviewTabId,
ProviderInstanceId,
+ ProviderInteractionMode,
+ RuntimeMode,
ThreadId,
} from "@t3tools/contracts";
import * as Deferred from "effect/Deferred";
@@ -940,3 +943,146 @@
}),
).pipe(Effect.provide(NodeHttpServer.layerTest)),
+​
+it.effect(
+ "narrows an OAuth client's modes to the T3-Mode-Limit it sends, and never widens them",
+ () =>
+ Effect.scoped(
+ Effect.gen(function* () {
+ const clientToken = "client-payload.client-signature";
+ const clientScope: McpInvocationContext.McpInvocationScope = {
+ environmentId,