Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): t3_thread_read defaults to smaller pages with tool-output previews #19758

Closedbmdavis419(GitHub profile, opens in a new tab)wants to merge 9 commits intomain fromfix/thread-read-smaller-defaultsopened View on GitHub

Showing 8 changed files with 212 additions and 1 deletion (loading 6).

x
0 of 8 viewed, 8 left
1 addition and 1 deletionapps/server/src/mcp/toolkits/orchestrator/tools.tsModified
View file
@@ -206,7 +206,7 @@
​
const ThreadReadTool = Tool.make("t3_thread_read", {
description:
- "Read durable state and a paginated timeline from any T3 thread in this environment. The default messages view returns user messages, assistant messages, and proposed plans; activity returns all summarized timeline items. Reading an untruncated terminal assistant result from this parent thread's direct app-owned child acknowledges that child's automatic completion delivery. Continue with afterPosition=nextPosition. Recover long item text with itemId and textOffset=nextTextOffset until nextTextOffset is null; offsets count UTF-16 code units. The thread also reports its snooze state and, in pullRequests, every linked pull request; linkedPullRequest is a legacy single link and can be null while pullRequests still has entries. To link a thread for the user, write `[title](t3-thread://v1/<threadId>)` with the threadId exactly as returned, not URL-encoded; T3 Code shows the thread's current title.",
+ "Read durable state and a paginated timeline from any T3 thread in this environment. The default messages view returns user messages, assistant messages, and proposed plans; activity returns all summarized timeline items. Defaults: 20 items per page, message text up to 4,000 chars, tool output previewed at 600 chars; maxCharsPerItem overrides both. Reading an untruncated terminal assistant result from this parent thread's direct app-owned child acknowledges that child's automatic completion delivery. Continue with afterPosition=nextPosition; recentRuns contains the newest 5 runs on the first page and is empty on later pages unless runLimit is set. Expand one truncated item with its itemId and textOffset=nextTextOffset (optionally a larger maxCharsPerItem) until nextTextOffset is absent; offsets count UTF-16 code units. The thread also reports its snooze state and, in pullRequests, every linked pull request; linkedPullRequest is a legacy single link and can be null while pullRequests still has entries. To link a thread for the user, write `[title](t3-thread://v1/<threadId>)` with the threadId exactly as returned, not URL-encoded; T3 Code shows the thread's current title.",
parameters: OrchestratorMcpThreadReadInput,
success: OrchestratorMcpThreadReadResult,
failure: OrchestratorMcpFailure,
211 additions and 0 deletionsapps/server/src/mcp/OrchestratorMcpService.activity.test.tsModified
View file
@@ -744,3 +744,214 @@
expect(result.items[1]).not.toHaveProperty("senderThreadId");
}).pipe(Effect.provide(layer), Effect.runPromise);
});
+​
+const readThreadId = ThreadId.make("thread-mcp-orchestrator-read");
+​
+function assistantRow(position: number, text: string) {
+ return {
+ position,
+ visibility: "local",
+ sourceThreadId: readThreadId,
+ sourceItemId: `item-${position}`,
+ item: {
+ id: `item-${position}`,
+ type: "assistant_message",
+ runId: "run-read-1",