Preview: reliable screenshots/inspection for tool-conservative models like Fable 5 - #326
Merged
Merged
Conversation
…odels like Fable 5 (P-PREVIEW.9)
Fable 5 (and the 4.8 family) reach for custom tools less than Opus/Sonnet and
sometimes narrate intent without emitting the call, so they watched tool calls
scroll by instead of verifying their UI in the preview.
- preview_extension.ts: rewrote preview_open / preview_screenshot /
preview_inspect descriptions to be trigger-prescriptive ('call this right
after you write/edit a UI file; a build/design task isn't done until you've
looked at it') - the Anthropic-recommended lever for this model. The
screenshot tool's empty-cache replies now self-correct, routing to
preview_open (re-surface) or preview_inspect (reads the rendered DOM, works
even when the panel isn't front) instead of dead-ending.
- app.ts kickPreviewShotSoon(): capture a fresh shot the moment the agent
preview lane surfaces, so preview_open -> preview_screenshot finds a fresh
image without waiting a full 1.5s freshness tick.
Verified: preview_extension 24/24, demo-P-PREVIEW.3a + .3a-shot green,
desktop + root tsc clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The report
Some model modes (Claude Fable 5 in particular) "just watch tool calls" instead of verifying their UI in the Preview panel or taking screenshots.
Root cause
Not a vision gap (Fable 5 has high-res vision) and not a missing tool —
preview_open/preview_screenshot/preview_inspectare loaded uniformly for every model. Two real causes:capturePagesees on-screen pixels only), and the model dead-ended there.The fix
harness/omp/preview_extension.ts— rewrote the three preview tool descriptions to be trigger-prescriptive ("call this right after you write/edit a UI file… a build/design task isn't done until you've looked at it"). This is Anthropic's recommended lever for Fable 5 — prescriptive at the tool-description level beats piling scaffolding into the system prompt (which hurts Fable 5). The screenshot tool's empty-cache replies now self-correct, routing topreview_open(re-surface) orpreview_inspect(reads the rendered DOM via the postMessage bridge — works even when the panel isn't front) instead of dead-ending.desktop/renderer/app.tskickPreviewShotSoon()— captures a fresh shot the moment the agent preview lane surfaces (onPreviewAvailable+ switch-to-agent), so apreview_open→preview_screenshotsequence finds a current image without waiting a full 1.5s freshness tick.Deliberately unchanged: the
capturePageon-screen-pixels constraint (a hidden agent lane still can't be screenshotted — that's whatpreview_inspectis for) and Fable 5's vision.Verification
preview_extension24/24 +demo-P-PREVIEW.3a/.3a-shotgreen; desktop + root tsc clean.kickPreviewShotSoon()with no console errors (capture no-ops gracefully whenisElectronis false), and the preview pipeline renders an HTML file end-to-end.capturePagescreenshot (Electron main process) and whether Fable 5 now calls the tools (a live Fable 5 session).Reconciliation
No overlap with the open PRs (#322/#323/#324 are all Dependabot bumps).
🤖 Generated with Claude Code