Skip to content

fix(agent): recover svg/canvas artifacts when the model skips the JSON action - #358

Merged
slaveofcode merged 1 commit into
developfrom
fix/agent-content-recovery
Aug 29, 2026
Merged

fix(agent): recover svg/canvas artifacts when the model skips the JSON action#358
slaveofcode merged 1 commit into
developfrom
fix/agent-content-recovery

Conversation

@slaveofcode

Copy link
Copy Markdown
Owner

From v2 testing on GLM: 'draw a rocket icon' → 'I didn't quite catch that', because a big SVG/code arg doesn't survive JSON-escaping so the model emits the artifact directly and parseAction fails. recoverContentAction runs the right generative tool on the raw output when a scoped svg/canvas tool matches it.

…ction

Generative tools carry a big SVG/code arg that rarely survives JSON-escaping, so
models (e.g. GLM) emit the <svg> or js code block directly and parseAction fails
-> 'I didn't quite catch that'. Add recoverContentAction: when parseAction fails
and a scoped generative tool matches raw output (an <svg> or a js fence), run that
tool on the raw content (the executor already extracts/sanitizes it).
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
⚠️ Deployment skipped
View logs
goodwebtools 6fedaa3 Aug 29 2026, 12:00 AM

@slaveofcode
slaveofcode merged commit f255fe0 into develop Aug 29, 2026
1 of 2 checks passed
@slaveofcode
slaveofcode deleted the fix/agent-content-recovery branch August 29, 2026 00:05
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