Skip to content

[2604 by GPT-5.6 Sol] MCP visual previews: list_visual_previews and get_visual_preview returning bounded, downscaled image content - #2647

Merged
propr-dev[bot] merged 2 commits into
2593-epic-mcp-observability-cf6from
2604/gpt-5.6-sol-mcp-visual-previews-list_-20260929-2142-29r
Sep 29, 2026
Merged

propr-dev[bot] merged 2 commits into
2593-epic-mcp-observability-cf6from
2604/gpt-5.6-sol-mcp-visual-previews-list_-20260929-2142-29r

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #2604

Branch: 2604/gpt-5.6-sol-mcp-visual-previews-list_-20260929-2142-29r
Commits: ✅ Changes committed (e1e05ad)


AI Processing Completed

Execution Details:

Summary:
Implemented GitHub issue #2604.

Key changes:

  • Added list_visual_previews and get_visual_preview.
  • Added task/PR association, private-goal visibility, disabled-repository handling, and caller-token media fetching.
  • Added bounded Sharp rendering with resizing, quality fallback, SVG/animated-image handling, and 750 KiB limit.
  • Added real MCP image content passthrough and blob resource support.
  • Added sharp dependency and production image smoke validation.
  • Added coverage for current and legacy MCP clients, videos, disabled repositories, visibility, token use, access logging, and 4000×3000 downscaling.
  • No visual preview artifact was created because this is backend-only.

Validation:

  • Full MCP suite: 178 passed
  • Root TypeScript build passed
  • API typecheck and lint passed
  • Sharp/libvips load check passed
  • Docker image execution was unavailable in this environment; the image smoke script now verifies Sharp at runtime.

Detailed Logs:

  • Conversation: 113 messages
  • Session: 01a0ef1f-9aa3-7441-ba63-2d100265bf43

Log files stored at:

  • conversation: /tmp/claude-logs/issue-2604-2026-09-29T21-59-19-162Z-conversation.json
  • output: /tmp/claude-logs/issue-2604-2026-09-29T21-59-19-162Z-output.txt
Latest Conversation Messages

This PR was created automatically by ProPR after processing issue #2604.


💡 Need changes?

Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!

…ews and get_

Implemented by ProPR AI using gpt-5.6-sol model.

Implementation completed successfully.
@propr-dev

propr-dev Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

/ultrafix
Triggered automatically by the requested execution settings.

@propr-dev propr-dev Bot added the ultrafix label Sep 29, 2026
@propr-dev

propr-dev Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 10)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev

propr-dev Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR adds task/PR preview discovery, image rendering, and MCP image/resource delivery. It needs a localized correction before merge because the new text-content path bypasses result redaction. Current head checks report 27 passed and no failures.

✅ Bounded image output — Rendering caps dimensions and reduces quality or dimensions until the encoded image fits within 750 KiB.

✅ Protocol coverage — The added integration test checks image blocks and blob resources through both current and legacy clients.

✅ Early video rejection — Published videos are rejected before their media body is downloaded.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F1: 🔴 Redact metadata in text content

  • Required behavior: Text metadata returned through the new MCP content path must preserve the existing result-redaction boundary.

  • Evidence: packages/api/mcp/toolsPreviews.ts:195, packages/api/mcp/toolExecution.ts:134, and packages/api/mcp/server.ts:46.

    1. A published preview has a title or description containing a secret value matched by the existing result redactor.
    2. get_visual_preview copies that metadata into both data and a text block, serializing the text block before returning.
    3. runTool applies redactToolResult to data, but forwards readContent unchanged.
    4. The server returns that original text block to the MCP client, exposing the value that was removed from the structured result.

    The previous text fallback serializes the redacted result; the new content override bypasses that protection. Both supported client paths receive the unredacted block. The added test checks metadata sizes but does not exercise secret-bearing metadata. Verification provenance: static trace of the supplied code; no commands or tests executed.

  • Minimum fix: Build the preview’s text metadata from the redacted result, or apply equivalent redaction to text content before returning it. Preserve the binary image data unchanged and add a regression asserting consistent redaction in text and structured content.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Exercise rendering fallback branches

The supplied test uses a solid-color PNG, which verifies downscaling but does not meaningfully exercise the encoded-size fallback. Add fixtures covering noisy images, PNG/JPEG output, SVG, animation, and malformed input. These would strengthen confidence in the rendering branches; their absence alone does not demonstrate another merge blocker.

Score

The implementation is focused and current checks are passing, but the new metadata delivery path bypasses an existing safety boundary. A localized fix and regression test should address the blocker.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 41s
  • Tokens: 51,390 (50,232 in / 1,158 out)
  • Cost: $0.46

View Task


💡 Next step: Comment /fix to address every F# merge blocker, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them, and they never relax a merge blocker.

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit b94cc01

Addressed 1 AI review comment (IDs: 5900055590)

Addressed finding F1

Summary of Changes

Implemented F1.

  • Restored redaction for MCP text-content overrides while preserving binary image/audio blocks unchanged in toolExecution.ts.
  • Added secret-bearing preview metadata regressions covering structured and text content for current and legacy MCP clients in mcpVisualPreviews.test.ts.

Validation:

  • Focused visual-preview test passed.
  • All 27 MCP test files passed.
  • API typecheck and lint passed.
  • git diff --check passed.
  • No independent defects found.
  • No visual preview generated because the change is backend-only.

🤖 Implementation Details

  • Model: GPT-5.6 Sol (high)
  • Requested By: @propr-ultrafix
  • Time: 6m 25s
  • Tokens: 965,045 (959,240 in / 5,805 out)
  • Cost: $0.87

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Implement fixes for issues found by /review /fix or /fix address the null check issue
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

Implemented F1.

- Restored redaction for MCP text-content overrides while preserving binary image/audio blocks unchanged in [toolExecution.ts](/tmp/git-processor/worktrees/integry/propr/pr-2647-followup-2026-09-29T22-12-06/packages/api/mcp/toolExecution.ts:94).
- Added secret-bearing preview metadata regressions covering structured and text content for current and legacy MCP clients in [mcpVisualPreviews.test.ts](/tmp/git-processor/worktrees/integry/propr/pr-2647-followup-2026-09-29T22-12-06/packages/api/test/mcpVisualPreviews.test.ts:135).

Validation:

- Focused visual-preview test passed.
- All 27 MCP test files passed.
- API typecheck and lint passed.
- `git diff --check` passed.
- No independent defects found.
- No visual preview generated because the change is backend-only.

PR: #2647
Comment by: @propr-ultrafix (ID: 0)
Model: gpt-5.6-sol
@propr-dev

propr-dev Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR adds visual-preview discovery and retrieval through MCP tools and blob resources. It is ready to merge based on the supplied code and authoritative checks: 27 passed, none failed or pending.

✅ Shared authorization path — Resource reads invoke the same tool execution path as tool calls, preserving scope and repository authorization.

✅ Bounded image responses — Downloads receive a source-size limit, rendering caps dimensions, and quality/resolution fallbacks enforce the rendered-byte limit.

✅ Protocol compatibility coverage — The added integration test exercises modern and legacy clients, image content, blob resources, metadata redaction, and caller-token fetching.

This was a static review of the supplied code; no commands or tests were run.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S2: 🟢 Exercise rendering fallback branches

The new test uses a solid-color PNG that compresses easily. Add cases for JPEG and PNG output, noisy images that require quality or dimension reduction, animated inputs, SVGs, and malformed media. These would strengthen coverage of renderImage beyond its default WebP success path; the supplied code does not establish a blocker in those branches.

S3: 🟢 Return preview resource links

presentation.ts currently gives get_visual_preview the generic connection resource link, although this PR registers a dedicated preview resource. Returning that URI would make the blob resource easier for clients to discover and reuse. This is optional because clients can already retrieve images through the tool and discover the resource template.

Score

The implementation is cohesive, includes meaningful integration coverage, and has no verified merge blockers or failing current-head checks. Additional rendering cases would improve confidence in its less frequently exercised branches.

Score: 9/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 29s
  • Tokens: 51,191 (50,409 in / 782 out)
  • Cost: $0.44

View Task


💡 Next step: Comment /fix to address every F# merge blocker, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them, and they never relax a merge blocker.

🤖 Review by ProPR

@propr-dev propr-dev Bot removed the ultrafix label Sep 29, 2026
@propr-dev
propr-dev Bot merged commit 8a606b7 into 2593-epic-mcp-observability-cf6 Sep 29, 2026
44 checks passed
@propr-dev
propr-dev Bot deleted the 2604/gpt-5.6-sol-mcp-visual-previews-list_-20260929-2142-29r branch September 29, 2026 22:32
propr-dev Bot pushed a commit that referenced this pull request Oct 5, 2026
… 1 is the chip and the title. Line 2 is the type tag followed by what the run did or why it failed. Row 2 from your screenshot now reads `Issue #86  Support configuration/…` on top and `✨ IMPLEMENT  Typecheck failed during test execution` underneath, which matches Row 1's layout.

Every row in the task list now has the same two lines. Line 1 is the chip and the title. Line 2 is the type tag followed by what the run did or why it failed. Row 2 from your screenshot now reads `Issue #86  Support configuration/…` on top and `✨ IMPLEMENT  Typecheck failed during test execution` underneath, which matches Row 1's layout.

All unit tests pass, the six task-related Playwright suites pass (36 tests), and lint is clean on the changed files.

**What changed:**
1. **Line 1 is only `[chip] title`.** The title stays on one line and is cut with `…` instead of wrapping. The full title is still in the tooltip. Nothing sits between the chip and the title anymore, so every title starts 8px after its chip. Chips are different widths (`PR #2647` vs `Issue #86`), so titles start at the same x only where the chips are the same width.
2. **Line 2 is always drawn.** The type tag lives only on line 2 now, and the special one-line layout for single runs is gone (in `TaskRows.tsx`).
   - When a run has no summary, line 2 shows its outcome: the first line of the failure reason, `Pushed commit abc1234`, `Waiting to start`, and so on.
   - That outcome used to be filled in only for rows with earlier runs. Now every row gets it (in `rowModel.ts`).
3. **Every row is the same height.** The preview-count badge made one row's second line 22px instead of 20px, so line 2 is now fixed at 20px. At 1920px every row is 63px tall.

**Laptop widths:** at 1280px the title column is narrow, so long titles are now cut much shorter, e.g. `Add keyboard shortcut…`. Before, they wrapped onto a second line. That's what the one-line rule asks for, but widening the title column would show more of each title if it feels too tight.

**Tests:** I updated the unit and Playwright tests that expected single runs to be one line or titles to wrap at 1280px. I added Playwright checks that all rows are the same height and that every title starts one gap after its chip. I also added a failure reason to the Issue #86 test data so line 2 has real text to show.

I captured two previews at 1920px: a close-up of the two rows from your screenshot, and the full list. A 1280px close-up came out with the footer over the second row, so I dropped it.

PR: #2728
Comment by: @integry (ID: 6003977249)
Model: claude-opus-5-5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants