Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(server): stop shipping full MCP tool results in thread payloads #5482

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/5482/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

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

x
0 of 3 viewed, 3 left
54 additions and 0 deletionsapps/server/src/orchestration/ActivityPayloadProjection.test.tsModified
View file
@@ -44,6 +44,60 @@
expect(data.somethingClientNeverReads).toBeUndefined();
});
​
+ it("slims Codex-shaped mcp_tool_call items to rendered fields plus a result summary", () => {
+ const projected = projectActivityPayload(
+ activity({
+ itemType: "mcp_tool_call",
+ data: {
+ item: {
+ type: "mcpToolCall",
+ id: "item-1",
+ tool: "fetch_pr",
+ server: "github",
+ status: "completed",
+ arguments: { pr: 42 },
+ durationMs: 1200,
+ result: {
+ content: [{ type: "text", text: `PR body line one\n${"x".repeat(5000)}` }],
+ structuredContent: { huge: "y".repeat(5000) },
+ },
+ _meta: { internal: true },
+ },
+ },
+ }),
+ );
+ const data = (projected.payload as Record<string, unknown>).data as Record<string, unknown>;
+ const item = data.item as Record<string, unknown>;
+ expect(item.tool).toBe("fetch_pr");
+ expect(item.server).toBe("github");