Repository navigation
Let html_render and html_preview reuse a previewed page instead of resending its HTML #18533
Closed
FreeRikato
started this conversation in
Ideas
Replies: 3 comments
|
much needed |
0 replies
|
A file
#17798 set
Would maintainers accept a workspace-scoped
|
0 replies
|
Closing as a duplicate of #23303, which tracks the same request. Please follow along there. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
When an agent shows a visual, it sends the whole HTML document on every call:
html_previewat 728px, darkhtml_previewagain at 390px, light (the loop the tool descriptions encourage)html_renderto publishThe server already holds the exact page after the first preview, but nothing lets the agent refer to it, so the page goes out three times. Output tokens are the slowest and most expensive part of a turn: a 30 KB page (a chart with embedded data) costs about 90 KB of agent output instead of 30 KB, plus the time to generate it. #17798 reports the same cost.
Proposal
html_previewreturns apreviewIdfor the page it rendered. Laterhtml_previewandhtml_rendercalls from the same thread can passpreviewIdinstead ofhtml.Measured on one page through the real tools:
previewIdhtml_preview(728, dark)html_preview(390, light)html_renderShape of the change:
invalid_requestand a message telling the agent to sendhtmlagain; ids reveal nothing across threads, and a restart just means one resend.htmlkeeps working exactly as today;previewIdis optional, and exactly one of the two is required.htmlRenderreference.Not proposed
pathinput (the server-read concern raised in feat: agents can show HTML pages inline in threads #15916).html_rendersizes or scrolls its frame.Questions for maintainers
I have an implementation with tests, including a real headless-browser run, ready to reopen as #18528 if the direction is approved.
All reactions