Before submitting
Area
apps/server
Steps to reproduce
- Start T3 Code with the built-in preview MCP tools available to a provider.
- Open a content-heavy page with a large accessibility tree or a large amount of visible text.
- Have the agent call
preview_snapshot.
- Inspect the tool result and continue the thread with another prompt.
The server currently serializes the complete snapshot metadata into both the text content and structuredContent of the tool result.
Expected behavior
preview_snapshot should keep the screenshot available while bounding the JSON metadata sent to the provider. If metadata must be omitted, the result should clearly say that it was truncated.
Actual behavior
preview_snapshot forwards the full page metadata, including the accessibility tree, without a size limit. On large pages this can add hundreds of kilobytes to a single tool result and consume most of the thread's context window.
In the observed session, a later turn failed with an internal provider error after the oversized snapshot result entered the conversation.
This happens at the preview MCP response boundary, so it is not specific to one provider.
Impact
Major degradation or frequent failure
Version or commit
main @ 82b8a93
Environment
macOS, local desktop build, Kiro CLI via ACP. The oversized response is produced by the provider-independent preview MCP server.
Logs or stack traces
Error: Internal error
at decodeJsonError (.../apps/server/dist/Schema-DNmPah4h.mjs:25100:111)
at decodeDefect (.../apps/server/dist/Schema-DNmPah4h.mjs:25136:54)
at sendTurn (.../apps/server/dist/bin.mjs:179228:26)
Screenshots, recordings, or supporting files
No screenshot included. PR #7408 contains a focused regression test that sends an oversized snapshot through the MCP tool and verifies that the returned metadata is bounded.
Workaround
Avoid preview_snapshot on content-heavy pages and use targeted preview_evaluate calls instead.
Proposed fix: #7408
Before submitting
Area
apps/server
Steps to reproduce
preview_snapshot.The server currently serializes the complete snapshot metadata into both the text content and
structuredContentof the tool result.Expected behavior
preview_snapshotshould keep the screenshot available while bounding the JSON metadata sent to the provider. If metadata must be omitted, the result should clearly say that it was truncated.Actual behavior
preview_snapshotforwards the full page metadata, including the accessibility tree, without a size limit. On large pages this can add hundreds of kilobytes to a single tool result and consume most of the thread's context window.In the observed session, a later turn failed with an internal provider error after the oversized snapshot result entered the conversation.
This happens at the preview MCP response boundary, so it is not specific to one provider.
Impact
Major degradation or frequent failure
Version or commit
main @ 82b8a93
Environment
macOS, local desktop build, Kiro CLI via ACP. The oversized response is produced by the provider-independent preview MCP server.
Logs or stack traces
Error: Internal error at decodeJsonError (.../apps/server/dist/Schema-DNmPah4h.mjs:25100:111) at decodeDefect (.../apps/server/dist/Schema-DNmPah4h.mjs:25136:54) at sendTurn (.../apps/server/dist/bin.mjs:179228:26)Screenshots, recordings, or supporting files
No screenshot included. PR #7408 contains a focused regression test that sends an oversized snapshot through the MCP tool and verifies that the returned metadata is bounded.
Workaround
Avoid
preview_snapshoton content-heavy pages and use targetedpreview_evaluatecalls instead.Proposed fix: #7408