Skip to content

Preview: reliable screenshots/inspection for tool-conservative models like Fable 5 - #326

Merged
mlcyclops merged 1 commit into
masterfrom
fix/preview-tools-fable5
Jul 24, 2026
Merged

Preview: reliable screenshots/inspection for tool-conservative models like Fable 5#326
mlcyclops merged 1 commit into
masterfrom
fix/preview-tools-fable5

Conversation

@mlcyclops

Copy link
Copy Markdown
Owner

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_inspect are loaded uniformly for every model. Two real causes:

  1. Fable 5 reaches for custom tools less than Opus/Sonnet, and sometimes narrates intent ("I'll screenshot it") without emitting the call. Anthropic documents both traits.
  2. The screenshot could return empty when the agent preview lane wasn't the front panel (capturePage sees 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 to preview_open (re-surface) or preview_inspect (reads the rendered DOM via the postMessage bridge — works even when the panel isn't front) instead of dead-ending.
  • desktop/renderer/app.ts kickPreviewShotSoon() — captures a fresh shot the moment the agent preview lane surfaces (onPreviewAvailable + switch-to-agent), so a preview_openpreview_screenshot sequence finds a current image without waiting a full 1.5s freshness tick.

Deliberately unchanged: the capturePage on-screen-pixels constraint (a hidden agent lane still can't be screenshotted — that's what preview_inspect is for) and Fable 5's vision.

Verification

  • preview_extension 24/24 + demo-P-PREVIEW.3a / .3a-shot green; desktop + root tsc clean.
  • Live smoke test (dev server + in-app browser): renderer boots clean, switching to the Agent lane fires kickPreviewShotSoon() with no console errors (capture no-ops gracefully when isElectron is false), and the preview pipeline renders an HTML file end-to-end.
  • QA-gated (needs a real environment): the actual capturePage screenshot (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

…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>
@mlcyclops
mlcyclops merged commit 0c8c282 into master Jul 24, 2026
5 checks passed
@mlcyclops
mlcyclops deleted the fix/preview-tools-fable5 branch July 24, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant