You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(server): keep thread tool responses small by default - #29268
Thread list and read calls can fill an agent's context when it follows other threads. Default pages now contain at most 10 items, and read items default to 500 characters. Existing cursors and explicit limits still let callers retrieve more; the CLI and remote delegation retain their previous chunk sizes.
Regression cases failed on the original defaults and pass with the fix, including pagination, text continuation, and explicit larger limits. The MCP service, CLI, and remote delegation suites passed (96 tests).
vp run check:changed passed.
Against an isolated dev server with a pruned copy of local data, the default list returned 10 of 43 threads with a cursor; a default read returned 10 items and a 500-character chunk. The next page, text continuation, and an explicit larger read returned the remaining data.
The MCP tool-use eval dry run passed; the paid model eval could not run because ANTHROPIC_API_KEY was unavailable.
Reviewed with review-loop: 1 round with GPT-6.1 Sol. Reviewer verdict: approved.
Macroscope's review found this PR requires human approval — MCP thread tools now default to 10 items and 500 characters per item, while CLI and remote-delegation reads retain larger chunks. These reduced product defaults change how much context callers receive without additional requests and require human review.
You can add or adjust custom eligibility rules. Learn more.
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
No actionable comments were generated in the recent review.
Walkthrough
MCP thread-list and thread-read defaults are reduced to 10 items and 500 characters per item. Terminal task-result acknowledgement now accounts for text offsets. CLI and remote delegation reads set per-item text limits.
Changes: Thread read limits
Layer / File(s)
Summary
MCP defaults and paginated result acknowledgement apps/server/src/mcp/OrchestratorMcpService.ts, apps/server/src/mcp/OrchestratorMcpToolkit.integration.test.ts, apps/server/src/mcp/OrchestratorMcpService.activity.test.ts
Thread-list and thread-read defaults are reduced. Terminal task-result acknowledgement checks include the requested text offset. Integration and activity tests cover text continuation, acknowledgement, item truncation, and timeline pagination.
CLI and delegation read limits apps/server/src/cli/thread.ts, apps/server/src/peer/RemoteDelegation.ts
CLI reads and the initial remote delegation read set a 20,000-character per-item limit. Later remote text-fetch requests retain their separate 50,000-character limit.
Issue 33417 — The issue reports default t3_thread_read output exceeding the MCP output limit. This change reduces the default page size and per-item text length, but does not add the proposed response budget or newest-page default.
Possibly related PRs
pingdotgg/t3code#33455: Both changes modify text-page semantics used to decide when terminal task results are acknowledged.
pingdotgg/t3code#33428: Both changes affect t3_thread_read defaults and the remote delegation read path.
pingdotgg/t3code#27273: Both changes affect text-page end calculations used in delegated-task result acknowledgement.
The change shrinks default thread tool responses while keeping continuation and explicit larger limits available. Delegated-result acknowledgement now accounts for paged text, and the reported tests cover it. No merge-blocking risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: thread tool responses are made smaller by default. It uses a conventional commit prefix and a specific scope. The changeset reduces default page sizes for thread list …
Description check
The description follows the repository template. It states the problem (thread list and read calls can fill an agent's context), the change (default page size of 10 items and 500-character read items)…
Linked Issues check
For [#29216], the whole-PR summary of apps/server/src/mcp/OrchestratorMcpService.ts shows thread-list and thread-read defaults reduced to 10 items. The maximum text per item is reduced from 20,000 to …
Out of Scope Changes check
For [#29216], each changed area supports the default-size objective or keeps existing behavior. OrchestratorMcpService.ts changes the defaults and adds the paged acknowledgement logic. The acknowledge…
Full details: Title check
Explanation
The title names the main change: thread tool responses are made smaller by default. It uses a conventional commit prefix and a specific scope. The changeset reduces default page sizes for thread list and read calls to 10 items and the default per-item text limit to 500 characters, which matches the title.
Full details: Description check
Explanation
The description follows the repository template. It states the problem (thread list and read calls can fill an agent's context), the change (default page size of 10 items and 500-character read items), and the scope (links issue #29216 as the bug). The verification section lists focused regression tests, the 96-test suites, the check run, and a manual dev-server check. It also states what could not be verified (paid model eval, missing API key). The template's optional model/harness line is present. Minor gap: the Scope section gives no explicit reason for the fix to skip a separate maintainer request, though it links an issue, so the requirement is met.
Full details: Linked Issues check
Explanation
For [#29216], the whole-PR summary of apps/server/src/mcp/OrchestratorMcpService.ts shows thread-list and thread-read defaults reduced to 10 items. The maximum text per item is reduced from 20,000 to 500 characters. These match the expected defaults of about 10 items and about 500 characters. Explicit limit and maxCharsPerItem parameters remain available. Paging uses the existing list cursor (nextCursor). Text continuation uses nextTextOffset. The activity test supplies 12 timeline rows and asserts a default page of 10 items, per-item truncation to 500 characters, a next text offset, and a next page after position 9. The integration test reconstructs a result longer than 500 characters through nextTextOffset. The issue asks for a nextPosition or equivalent cursor. nextCursor is an equivalent cursor. The acknowledgement change in pageIncludesTerminalTaskResult lets paged reads acknowledge a terminal delegated result. This keeps delivery state correct under the new paging. Manual dev-server, Linux VM, and eval checks are non-coding and were not assessed. Residual uncertainty: the summary, not a line-level diff, was used for the acknowledgement logic and for the non-core files.
Full details: Out of Scope Changes check
Explanation
For [#29216], each changed area supports the default-size objective or keeps existing behavior. OrchestratorMcpService.ts changes the defaults and adds the paged acknowledgement logic. The acknowledgement change supports the new paging. Without it, paged reads would not acknowledge delivery of a terminal delegated result. apps/server/src/cli/thread.ts and apps/server/src/peer/RemoteDelegation.ts set a 20,000-character per-item limit. This keeps their chunk sizes unchanged, as the PR description states. The test files (OrchestratorMcpService.activity.test.ts and OrchestratorMcpToolkit.integration.test.ts) cover the changed behavior. No unrelated change appears in the whole-PR summary. Residual uncertainty: the other changed files were assessed from the summary, not from a line-level diff.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.
verified on linux with the real dev web app, repo playwright, google chrome, and codex gpt-6.1-sol through the local proxy. no mocks or seeded fixtures. main and the pr ran sequentially with isolated state and the same app-created threads.
main a036489016: default list returned all 12 threads; activity read returned 28 items with a 20,000-character chunk.
pr: list returned 10 + 2 threads with matching ids. activity returned 10 items with a 500-character maximum. text continuation reconstructed the original 1,995-character response exactly. explicit larger limits and full CLI output still worked.
found and fixed the delegated-result acknowledgement regression in cf8578f4c2022643147d0bef944dc6ce7ee8bdac. before: reading all six chunks of a real child's 2,571-character response left delivery unacknowledged; an explicit full read acknowledged it. after: a fresh real child's 1,529-character response, read only as 500/500/500/29 chunks, was acknowledged. checked the persisted delivery state read-only.
the added row in the existing integration test failed before the fix and passed afterward. vp run check:changed 47f2c8d29e981c7723467efe137ee19e91df924e passed through blacksmith-check, including format, lint, typechecks and 101 tests.
native desktop, ios/android clients, other providers, and live linked-environment delegation were not exercised on this linux vm. remote delegation's existing tests passed. all 29 github checks passed on cf8578f4c2022643147d0bef944dc6ce7ee8bdac; the scoped blacksmith checks also passed.
699-704: Trivial · Maintainability & Code Quality · Low value
Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.
Assert the delivery state after the tail read at the full result length.
This call reads at textOffset: result.length. It returns an empty page. The test then checks claimed only in the continuation loop. If the tail read acknowledged the result, the first loop iteration would catch it only when finalItem.nextTextOffset is non-null. That holds for long results, so the loop does cover it. The tail read itself, however, has no explicit assertion on its outcome. Add one assertion on completionDelivery.state right after the read so a regression points to this call.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
Seed each real server with 12 synthetic threads and 12 visible messages, including 1,656-character assistant replies. Call both tools without limits, follow their continuations, then request explicit larger limits.
On head, pagination recovered all 12 threads and messages. Text continuation returned 500 + 500 + 500 + 156 characters, exactly reconstructing the full reply. Explicit larger limits returned all 12 entries and full text on both commits.
Environment: real Linux server, fresh isolated database per commit, synthetic replay history, MCP over loopback HTTP. Captures omit credentials, internal paths, and model metadata.
AI-assisted; verified with the tests and tools listed above.
Not shown:
Delegated-task result acknowledgement across text continuation was not exercised; this reproduction uses top-level threads.
Calls were issued directly through MCP rather than by a live model in the web client; replay emits recorded replies and does not invoke these MCP tools.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:M30-99 changed lines (additions + deletions).vouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thread list and read calls can fill an agent's context when it follows other threads. Default pages now contain at most 10 items, and read items default to 500 characters. Existing cursors and explicit limits still let callers retrieve more; the CLI and remote delegation retain their previous chunk sizes.
Fixes https://git.cafe/pingdotgg/t3code/issues/29216. This is a focused fix for the oversized defaults in the existing tools; it introduces no new workflow or configuration.
Verification:
vp run check:changedpassed.ANTHROPIC_API_KEYwas unavailable.Reviewed with review-loop: 1 round with GPT-6.1 Sol. Reviewer verdict: approved.
Created with GPT-6.1 Terra in Codex.
Fixes #29216