fix(server): prevent preview_snapshot from bricking sessions with oversized images - #11624
fix(server): prevent preview_snapshot from bricking sessions with oversized images#11624Exotic209093 wants to merge 1 commit into
Conversation
Bugbot is paused — on-demand spend limit reachedBugbot 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. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a small, self-contained regression fix that removes oversized inline PNG payloads from MCP history while preserving snapshot metadata and existing preview behavior. The focused test covers the changed response shape. You can add or adjust custom eligibility rules. Learn more. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 431dcc93cc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| mimeType: screenshot.mimeType, | ||
| }, | ||
| ], | ||
| content: [{ type: "text", text: JSON.stringify(metadata) }], |
There was a problem hiding this comment.
Return a bounded screenshot to image-capable providers
For providers/models that accept MCP image blocks, every preview_snapshot now returns only page metadata, so pages whose relevant state is visual-only (canvas output, layout defects, video frames, or other non-semantic content) can no longer be inspected by the agent even though PreviewSnapshotTool still promises a PNG screenshot. The client preview's copy is visible to the user, not to the provider consuming this MCP response; preserve a size-bounded/downscaled image for compatible providers, or omit it only for adapters that cannot accept one.
AGENTS.md reference: AGENTS.md:L69-L72
Useful? React with 👍 / 👎.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe preview snapshot MCP tool no longer returns inline base64 PNG content. It returns textual metadata and structured screenshot metadata. The test now verifies that the response contains one text entry and no image entry. ChangesPreview snapshot response
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to The snapshot response no longer embeds inline image data that can break provider sessions, while clients retain the metadata needed to render their own image copy. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 2⚔️ Resolve merge conflicts 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Comment |
The preview_snapshot MCP tool embedded full-resolution base64 PNGs directly into tool history as inline image content blocks. When providers reject inline images, this permanently bricks the session because the oversized payload cannot be removed from history. Removed the inline image content block from snapshot results; structured metadata (dimensions, mime type) is still returned for reference while the client renders the actual image from its own copy.
Fixes #11295
Summary by CodeRabbit