fix(mcp): preview errors tell agents what to do instead - #13559
Conversation
On headless hosts, preview tools failed with "MCP credential does not grant the preview capability" or "No active preview tab", and agents could not tell what to do next. The messages now name the fallback: call preview_open, use a shell browser, or ask the user to open the desktop app. preview_snapshot failures now show these messages too. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a small MCP-focused fix that improves existing preview error responses with actionable fallback instructions while leaving successful behavior and existing non-preview fallbacks unchanged. The updated production paths are covered by focused tests, with no product-default, schema-breaking, deployment, or static-analysis changes. Notes:
You can add or adjust custom eligibility rules. Learn more. |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 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.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: pingdotgg/t3code/.coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: 5 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour. 📝 WalkthroughWalkthroughPreview automation errors now provide operation-specific recovery guidance. MCP snapshot responses include the message when the first failure is a preview automation error. Other failures continue to use the error tag. ChangesPreview automation errors
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The preview responses provide recovery guidance without exposing renderer-supplied diagnostics. No unresolved merge risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Dismissing prior approval to re-evaluate dd3431e
Upstream's no-host error now tells agents not to retry (pingdotgg#13559). Cody's broker raises that error when a call times out while the thread's desktop is still inside its reconnect grace period, so agents gave up on a desktop that was about to return. That case now carries reason "reconnecting" and asks for a retry in a few seconds. Every other no-host error keeps upstream's message.
## What's Changed * feat(web): control Android foldables in the Device panel by @juliusmarminge in pingdotgg/t3code#13534 * fix(mcp): preview snapshots fit in the agent's tool output again by @t3dotgg in pingdotgg/t3code#13558 * fix(web): paste after clicking away from the composer lands in it again by @t3dotgg in pingdotgg/t3code#13553 * feat(desktop): keep running threads synced in the background by @t3dotgg in pingdotgg/t3code#13554 * fix(mcp): preview errors tell agents what to do instead by @t3dotgg in pingdotgg/t3code#13559 * feat(web): agents working banner links to the Agents panel by @t3dotgg in pingdotgg/t3code#13572 * fix(web): size the Android fold model from the inner display by @juliusmarminge in pingdotgg/t3code#13574 * fix(clients): a preview app no longer knocks the desktop's own server offline by @t3dotgg in pingdotgg/t3code#13577 * fix(web): keep nested task states out of parent bullets by @dominic-r in pingdotgg/t3code#11477 * feat(release): ship a Linux .deb that updates itself by @t3dotgg in pingdotgg/t3code#13575 * perf(desktop): cache compiled JavaScript between launches by @t3dotgg in pingdotgg/t3code#13501 * fix(dev): one t3.json setup action that works on every OS by @t3dotgg in pingdotgg/t3code#13589 * fix(web): new worktree threads no longer say "checkout" during setup by @t3dotgg in pingdotgg/t3code#13590 * fix(desktop): `t3 app` keeps working after a second desktop app quits by @t3dotgg in pingdotgg/t3code#13585 * fix(usage): price Claude fast-mode requests at the fast rate by @t3dotgg in pingdotgg/t3code#13599 * fix: update OpenAI logo to current brand asset by @aaditagrawal in pingdotgg/t3code#13611 * fix(mobile): render assigned project icons in chat list by @SunkenInTime in pingdotgg/t3code#12810 ## New Contributors * @aaditagrawal made their first contribution in pingdotgg/t3code#13611 **Full Changelog**: pingdotgg/t3code@v0.0.43-nightly.20260925.2237...v0.0.43-nightly.20260925.2251 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.43-nightly.20260925.2251
On headless hosts, preview tools fail with "MCP credential does not grant the preview capability" or "No active preview tab". Agents could not tell what to do next, so they retried or gave up.
What Changed
The error messages now name the next step. Agents read these messages directly as the tool result.
PreviewAutomationUnavailableError): do not retry. Use a headless browser from the shell, such as Playwright, or curl. The user can turn on "Agent browser access" in Settings.PreviewAutomationNoAvailableHostError): preview tools run in a connected T3 Code desktop app, and a headless server has no browser. Do not retry. Use a shell browser, or ask the user to open the thread in the desktop app.PreviewAutomationTabNotFoundError): callpreview_openfirst.preview_snapshothas its own failure path that showed only the error tag, for examplePreview snapshot failed: PreviewAutomationUnavailableError.It now shows the message for preview errors, in both the text andstructuredContent. Clients differ in which one they show the model. These messages come from the server, never from page output, so nothing from the browser leaks.Checklist
Tested with
vp test runon the MCP server, invocation context, broker, and preview toolkit tests. Server and contracts typecheck and lint are clean.Made with Claude Opus 5.5 in Claude Code.
🤖 Generated with Claude Code
Summary by CodeRabbit