Skip to content

fix(mcp): allow text-only preview snapshots - #10232

Merged
t3dotgg merged 2 commits into
mainfrom
audit/text-only-preview-snapshot-10187
Sep 6, 2026
Merged

fix(mcp): allow text-only preview snapshots#10232
t3dotgg merged 2 commits into
mainfrom
audit/text-only-preview-snapshot-10187

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Sep 5, 2026

Copy link
Copy Markdown
Member

Closes #10187.

Repeated preview_snapshot calls add a PNG to each MCP result. Providers or gateways with image-count limits may reject the accumulated conversation.

Add optional includeImage. {"includeImage":false} returns fresh page metadata and JSON text without an image content part. Omitted or true preserves the existing PNG response. The flag stays inside the MCP server. Browser capture and the shared snapshot contract are unchanged.

The user selected this opt-in mitigation with current defaults preserved. It cannot remove images already in provider-owned history, does not stop host capture, and does not guarantee that a gateway accepts an existing conversation. The reporter's original gateway rejection was not replayed.

Verification on integrated main 585ce2c2:

  • The registered MCP tool and real preview broker use a synthetic host. Exact-main before controls fail twice and pass 12 tests. The candidate passes all 14, including the existing HTTP session lifecycle test.
  • Six text-only calls return fresh metadata with no image. A following default call returns PNG again. Repeated default and explicit-image calls preserve the PNG bytes and metadata. Tab targeting, bounded host errors and invalid inputs are covered.
  • The orchestrator independently reviewed all four changed files, ran both sides, and passed scoped typecheck and changed-file lint. Two unchanged Effect suggestions remain in the server environment machine.

The subsequent f12d3935 main update does not change the MCP implementation or preview contracts. No client UI changed, so screenshots are not applicable. This is protocol/output evidence, not a browser, native or real-provider claim.

Ready for human review; unmerged. Current-head CI finished with 16 successful and four skipped checks. The orchestrator read all check outputs, annotations, comments and reviews; no unresolved finding remains. The configured Cursor review is paused by its spending limit, so its successful dispatch is not claimed as a code review.

Implemented with GPT 6 Astra via Codex in T3 Code.

Note

Allow text-only preview snapshots in McpHttpServer

  • Adds test coverage for includeImage=false and omitted includeImage in preview_snapshot, verifying failure responses stay bounded and omit image content
  • Adds a parameterized integration test confirming repeated preview_snapshot calls return fresh metadata with distinct titles, include a PNG by default or when explicitly enabled, and omit it when disabled
  • Adds rejection tests for non-boolean includeImage values (string, numeric, null), asserting they fail with an AiError summary before browser-host selection
  • Risk: no behavioral change beyond test coverage; all modifications are in McpHttpServer.test.ts

Macroscope summarized 3d458d3.

@cursor

cursor Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Sep 5, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 3d458d3

Macroscope's review found this PR approvable — This preserves existing PNG responses by default while adding a small, explicitly selected includeImage=false MCP option that returns the same metadata without the image content part. Browser capture and shared contracts remain unchanged, and the new behavior is covered by focused integration tests.

You can add or adjust custom eligibility rules. Learn more.

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.6 KiB 13.5 KiB −56 B (−0.4%) 15.1 KiB
Codex Thread snapshot wire 7.0 KiB 7.0 KiB −7 B (−0.1%) 7.3 KiB
Codex Live turn WebSocket wire 6.6 KiB 6.5 KiB −49 B (−0.7%) 7.8 KiB
Codex Live turn WebSocket decoded 57.1 KiB 57.0 KiB −88 B (−0.2%) 66.4 KiB
Codex Live turn messages 10 8 −2 (−20.0%) 21
Claude Total thread wire 13.5 KiB 13.6 KiB +39 B (+0.3%) 15.1 KiB
Claude Thread snapshot wire 7.0 KiB 7.0 KiB +9 B (+0.1%) 7.3 KiB
Claude Live turn WebSocket wire 6.5 KiB 6.5 KiB +30 B (+0.5%) 7.8 KiB
Claude Live turn WebSocket decoded 57.8 KiB 57.8 KiB +44 B (+0.1%) 66.4 KiB
Claude Live turn messages 8 9 +1 (+12.5%) 21

Baseline: f12d393 · PR result: 3d458d3 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 113.8 KiB
  • Claude decoded thread snapshot: 114.5 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@t3dotgg
t3dotgg merged commit 29c5ecd into main Sep 6, 2026
21 checks passed
@t3dotgg
t3dotgg deleted the audit/text-only-preview-snapshot-10187 branch September 6, 2026 23:37
BarretoDiego pushed a commit to BarretoDiego/t3code that referenced this pull request Sep 7, 2026
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Sep 7, 2026
## What's Changed
* fix(clients): show feedback results in composer banners by @juliusmarminge in pingdotgg/t3code#10398
* fix(server): stop Windows terminal polling from spiking CPU by @UtkarshUsername in pingdotgg/t3code#9476
* fix(web): onboarding installs agents without needing Node or npm by @t3dotgg in pingdotgg/t3code#10402
* fix(server): allow settling threads with unanswered async questions by @t3dotgg in pingdotgg/t3code#10400
* feat(ci): ship stable releases from the latest nightly commit by @t3dotgg in pingdotgg/t3code#10410
* feat(marketing): add a nightly channel to the download page by @t3dotgg in pingdotgg/t3code#10408
* fix(web): keep settings inputs focused during IME composition by @Lucenx9 in pingdotgg/t3code#10262
* fix(server): preserve Codex reset credits during usage updates by @yashranaway in pingdotgg/t3code#10308
* docs: link the repository security reporting policy by @yashranaway in pingdotgg/t3code#10303
* fix(web): only show auto balance errors after failed checks by @maria-rcks in pingdotgg/t3code#10407
* fix(web): improve preview recording frame delivery by @maria-rcks in pingdotgg/t3code#10403
* fix(server): preserve inline provider secrets on redacted saves by @maxwellyoung in pingdotgg/t3code#10054
* fix(web, mobile): replace Apple desktop machine labels by @extoci in pingdotgg/t3code#10396
* fix(web): hide browser when the right panel starts closing by @Neel2107 in pingdotgg/t3code#10385
* fix(web): keep settings section headings description-free by @maria-rcks in pingdotgg/t3code#10415
* fix(usage): read and redeem hub reset credits through CLIProxyAPI by @juliusmarminge in pingdotgg/t3code#10395
* fix(web): deduplicate expanded tool labels and keep errors expandable by @Yash-Singh1 in pingdotgg/t3code#10420
* fix(server): skip git status scans while the index is locked by @Gigioxx in pingdotgg/t3code#9845
* fix(mcp): allow text-only preview snapshots by @juliusmarminge in pingdotgg/t3code#10232
* fix(claude): name the expired login or usage limit instead of a generic API error by @vitalyiegorov in pingdotgg/t3code#10321
* feat(mobile): queue a message while its attachment is still uploading by @juliusmarminge in pingdotgg/t3code#10404
* feat(mobile): show when an existing thread has a message waiting in the outbox by @juliusmarminge in pingdotgg/t3code#10405
* fix(codex): accept misalignment policy errors on thread resume by @realbakari in pingdotgg/t3code#10373
* fix(server): skip disabled settlement lookups by @t3dotgg in pingdotgg/t3code#10424
* fix(server): run OpenCode CLI commands sequentially by @t3dotgg in pingdotgg/t3code#10427
* feat(web): name the drop action while dragging sidebar threads by @SunkenInTime in pingdotgg/t3code#10378
* perf(web): keep the sidebar responsive during bulk thread updates by @t3dotgg in pingdotgg/t3code#10413
* fix(web): onboarding wizard now supports light mode by @t3dotgg in pingdotgg/t3code#10432
* feat(threads): dismiss async questions without replying by @t3dotgg in pingdotgg/t3code#10431
* fix(web): stop collapsing the composer when it loses focus by @t3dotgg in pingdotgg/t3code#10437
* fix(server): keep interrupted threads resumable after restarts by @maria-rcks in pingdotgg/t3code#10421

## New Contributors
* @Neel2107 made their first contribution in pingdotgg/t3code#10385
* @realbakari made their first contribution in pingdotgg/t3code#10373

**Full Changelog**: pingdotgg/t3code@v0.0.39-nightly.20260906.1316...v0.0.39-nightly.20260907.1325

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.39-nightly.20260907.1325
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

preview_snapshot accumulates unbounded image attachments, breaking providers with per-request image limits

2 participants