The best way to control Claude Code, Codex and more from any computer or phone
perf(server): MCP calls skip the caller's message history (#28282)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: maria-rcks <maria@kuuro.net>
Victor Vogel committed
Nov 1, 2026 at 16:02 UTC
f5fe88bc4e023ea97aca3763bdc5793beca43f58
2 files changed
+11
-6
apps/server/src/mcp/OrchestratorMcpService.ts
+3
-4
@@ -1119,7 +1119,6 @@ const make = Effect.gen(function* () {
1119
1120
const loadCaller = Effect.fn("OrchestratorMcpService.loadCaller")(function* (
1121
scope: McpInvocationScope,
1122
- includeUserMessages = true,
1122
) {
1123
yield* requireCapability(scope);
1124
if (scope.thread === undefined) {
@@ -1128,7 +1127,8 @@ const make = Effect.gen(function* () {
1127
limits: clientModeCeiling(scope.client),
1128
} as const;
1129
}
1131
- const parent = yield* loadProjection(scope.thread.threadId, includeUserMessages);
1130
+ // No loadCaller consumer reads the caller's own prompts.
1131
+ const parent = yield* loadProjection(scope.thread.threadId, false);
1132
return {
1133
parent,
1134
limits: {
@@ -1244,8 +1244,7 @@ const make = Effect.gen(function* () {
1244
scope: McpInvocationScope,
1245
threadId: ThreadId,
1246
) {
1247
- // Caller prompts are not used to read a timeline or acknowledge a child result.
1248
- const { parent } = yield* loadCaller(scope, false);
1247
+ const { parent } = yield* loadCaller(scope);
1248
const shell = yield* threadManagement
1249
.getThreadShell(threadId)
1250
.pipe(Effect.mapError(threadManagementFailure));
apps/server/src/mcp/OrchestratorMcpToolkit.integration.test.ts
+8
-2
@@ -606,14 +606,13 @@ describe("orchestrator MCP toolkit", () => {
606
span.end = (endTime, exit) => {
607
end(endTime, exit);
608
const query = span.attributes.get("db.query.text");
609
+ if (typeof query !== "string") return;
610
if (
610
- typeof query === "string" &&
611
/SELECT[\s\S]*FROM orchestration_v2_projection_context_transfers/i.test(query)
612
) {
613
transferReads.push(query);
614
}
615
if (
616
- typeof query === "string" &&
616
/SELECT\s+payload_json\s+FROM orchestration_v2_projection_messages/i.test(query)
617
) {
618
messageReads.push(query);
@@ -689,6 +688,13 @@ describe("orchestrator MCP toolkit", () => {
688
afterRead.subagents.find((task) => task.id === queuedFollowup.taskId)
689
?.completionDelivery?.state,
690
).toBe("acknowledged");
691
+
692
+ const messageReadsBeforeCapabilities = messageReads.length;
693
+ const capabilities = yield* invoke("orchestrator_capabilities", {}).pipe(
694
+ Effect.withTracer(tracer),
695
+ );
696
+ expect(capabilities.isError).not.toBe(true);
697
+ expect(messageReads).toHaveLength(messageReadsBeforeCapabilities);
698
}).pipe(Effect.provide(layerTest));
699
}),
700
),