fix(server): t3_thread_read defaults to smaller pages with tool-output previews #19758
Closed
bmdavis419(GitHub profile, opens in a new tab)wants to merge 9 commits into
main fromfix/thread-read-smaller-defaults·opened View on GitHubShowing 8 changed files with 212 additions and 1 deletion (loading 6).
x
@@ -206,7 +206,7 @@
- "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.",
211 additions and 0 deletions+211-0apps/server/src/mcp/OrchestratorMcpService.activity.test.tsModifiedView file
@@ -744,3 +744,214 @@
+
+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",