GeezerVison is showing github.com — fix(mcp): include completed user input answers in thread reads by hukq16 · Pull Request #44542 · pingdotgg/t3code
Conversation
Problem
In t3_thread_read (view: "activity"), turnItemText serializes every user_input_request item as jsonText(item.questions) even after the user has answered it. Although Orchestrator persists questionAnswer on the canonical turn item, MCP readers cannot retrieve selected options, multi-select values, custom text, or attachment metadata once the request is completed (and t3_pending_request rejects already-answered requests).
Change
- Keep pending or answerless (e.g. dismissed)
user_input_request items backward compatible by returning the existing questions JSON array whenever item.questionAnswer === undefined.
- When
item.questionAnswer is present, serialize { answers, attachmentsByQuestionId?, questions } with answers placed before questions so existing maxCharsPerItem and textOffset pagination surface submitted answers first.
- Omit empty
attachmentsByQuestionId maps, omit redundant questionTextById, and project attachment entries down to { type, id, name, mimeType, sizeBytes } (stripping source payloads).
- Add focused regression unit tests in
apps/server/src/mcp/OrchestratorMcpService.activity.test.ts covering pending requests, completed requests with single/multi/custom answers and attachment metadata, maxCharsPerItem: 80 + textOffset pagination, and empty attachment map omission.
Scope
Fixes #44540.
Focused server-side bug fix in the MCP activity serializer with unit test coverage. No contract schema or client changes are required.
Verification
How the bug was found and verified:
- Observed
t3_thread_read (view: "activity") returning only the questions array for a completed user_input_request while t3_pending_request rejected it as already answered.
- Verified the new regression test fails against unmodified
OrchestratorMcpService.ts (expected ... to contain '"answers"') and passes with the fix: pending items return JSON.stringify(questions, null, 2), page 1 under maxCharsPerItem: 80 contains "answers" before "questions", reassembled textOffset pages parse to valid JSON with { answers, attachmentsByQuestionId, questions } (without questionTextById or attachment source), and empty attachmentsByQuestionId maps are omitted.
Commands run on the final commit:
pnpm exec vp test run apps/server/src/mcp/OrchestratorMcpService.activity.test.ts — 13 passed
pnpm exec vp test run apps/server/src/mcp/OrchestratorMcpService.activity.test.ts apps/server/src/mcp/OrchestratorMcpService.test.ts — 117 passed across 2 files
pnpm --filter t3 exec effect-tsgo tsrs --noEmit — exit 0 (0 diagnostics)
pnpm exec vp fmt --check apps/server/src/mcp/OrchestratorMcpService.ts apps/server/src/mcp/OrchestratorMcpService.activity.test.ts — exit 0
pnpm exec vp lint --report-unused-disable-directives apps/server/src/mcp/OrchestratorMcpService.ts apps/server/src/mcp/OrchestratorMcpService.activity.test.ts — exit 0
Not checked:
- Local environment ran Node v24.22.1 with pnpm 12.14.0 (repo engines pin Node 26.13.1); no UI/client changes were made so no browser/screenshot check applies.
Model: GPT-6.2 Astra
Harness: T3 Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 27, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
The activity view now includes answers and non-empty attachment metadata for completed user-input requests. Pending requests continue to show questions only. Tests cover pending and completed requests, including attachment metadata filtering.
Changes: Activity view
| Layer / File(s) |
Summary |
Render completed answers and verify activity output apps/server/src/mcp/OrchestratorMcpService.ts, apps/server/src/mcp/OrchestratorMcpService.activity.test.ts |
Completed requests include answers and non-empty attachment metadata alongside questions. Pending requests continue to show questions only. Tests cover attachment field filtering and empty attachment mappings. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested reviewers: juliusmarminge, svetlomirb
Merge Risk: Minimal · up to ebb07
-
Completed user-input requests in the activity view now show their submitted answers and attachment metadata, and pending requests are unchanged. No concrete merge-blocking risk was identified.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title follows conventional commit format and names the main change: completed user input answers are now included in MCP thread reads. It matches the raw summary, which describes serializing answe… |
| Description check |
 |
The description follows the repository template. It has Problem, Change, Scope, and Verification sections, and each section has specific content. The Problem section explains the bug and expected beha… |
| Linked Issues check |
 |
Issue #44540 requires completed user_input_request activity items to expose submitted answers and non-empty attachment metadata alongside questions, including under maxCharsPerItem and textOffset pagi… |
| Out of Scope Changes check |
 |
The whole-PR change set contains the turnItemText serializer change in OrchestratorMcpService.ts and regression tests in OrchestratorMcpService.activity.test.ts. The source diff is confined to the use… |
Full details: Title check
-
Explanation
The title follows conventional commit format and names the main change: completed user input answers are now included in MCP thread reads. It matches the raw summary, which describes serializing answers and attachment metadata for completed user_input_request items in the activity view.
Full details: Description check
-
Explanation
The description follows the repository template. It has Problem, Change, Scope, and Verification sections, and each section has specific content. The Problem section explains the bug and expected behavior. The Change section lists the serializer updates and regression tests. The Scope section links issue #44540 and explains why this is a bug fix. The Verification section gives the exact commands, their results, and the environment limits. It also names the model and harness, as the template asks. The description is complete.
Full details: Linked Issues check
-
Explanation
Issue #44540 requires completed user_input_request activity items to expose submitted answers and non-empty attachment metadata alongside questions, including under maxCharsPerItem and textOffset paging. The whole-PR diff (merge base bf6c5df to head ebb0781) for apps/server/src/mcp/OrchestratorMcpService.ts in turnItemText shows: when item.questionAnswer is undefined, it returns jsonText(item.questions), which keeps pending and dismissed requests backward compatible. When questionAnswer is present, it returns jsonText({ answers, attachmentsByQuestionId?, questions }), with answers first. Empty attachment arrays and empty maps are dropped. Each attachment is projected to { type, id, name, mimeType, sizeBytes }, so source payloads are excluded. This covers the answer types named in #44540 (single-select, multi-select, custom text, attachments). The source hunk was read this review, which resolves the previous limitation. The activity test file was not re-read; its behavior is taken from the PR summary and the earlier test diff, and the test was not executed in this review. Coding requirements are met by source evidence.
Full details: Out of Scope Changes check
-
Explanation
The whole-PR change set contains the turnItemText serializer change in OrchestratorMcpService.ts and regression tests in OrchestratorMcpService.activity.test.ts. The source diff is confined to the user_input_request case in turnItemText and has no unrelated edits. The serializer change is the fix requested by #44540. The PR states that no contract schema or client changes were made, and the diff contains none. The test file was not re-read in this review, but its described scope matches the same behavior and does not show unrelated changes.
Finishing Touches
-
Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between cfa6805 and ebb0781.
Files selected for processing: 1
-
apps/server/src/mcp/OrchestratorMcpService.activity.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Evidence
Submit Strict schemas (Recommended) in the real web app, wait for completion, then call t3_thread_read from a separate MCP client with view activity. Repeat with maxCharsPerItem: 80 and follow nextTextOffset. Base omits answers; head includes the submitted answer and reconstructs it completely through pagination. Both runs used fresh databases, the repository question replay, a 1280×800 viewport, and light theme. The labeled capture panel displays actual MCP output.
Scenario source
Not shown:
- Multiple selections, custom text, attachment metadata, and attachment source-payload exclusion were not exercised: the repository question replay used here offers a single-choice question without custom answers.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:S
10-29 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
Milestone
No milestone
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.
|