Repository navigation
Conversation
Pages get a t3.send(text, data) bridge that posts a user message into the thread. Web sends only right after a click or key press in the page; mobile asks first. A new html_guide tool holds the design guide, so the tool list shrinks.
The visuals rule now names when to show a page: charts for trends, diagrams or clickable steps for explanations of linked parts, and controls for a choice. The rule is shorter than before, so the agent context budget goes down.
The visuals rule now tells the agent to show a page for a how-does-it-work question about a system of linked parts, and to keep brief answers as text. A new eval case reproduces a compiler walkthrough that came back as text.
Models skipped the optional guide and made white pages with gradients and a fixed row of feedback buttons. html_render now needs the key that html_guide returns. The guide asks for one diagram-led idea per page, larger text, interaction only where it shows something, and no commands run to fill a page. T3 theme tokens now win over a page's own :root copies.
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.
Summary
An agent can now build a page in the thread that also gets answers back from the user. A page calls
t3.send(text, data)and the text, with the data as a JSON block, goes into the thread as a normal user message that starts the next turn. The design guide moves into a newhtml_guidetool, so the MCP tool list gets smaller.Preview
A real Claude Haiku turn, made headless, after the guide changes. The prompt was only "I am new to compilers. Explain how a small compiler turns TSL into Python", with no layout instructions. The agent read
html_guide, then rendered this.Talk-back test from an earlier run, where the prompt asked for reply buttons: a headless click on Parse, then "Lost me here", put this message in the thread:
A headless click on Parse, then "Lost me here", put this message in the thread:
The agent's next turn explained the Parse stage.
Changes
packages/shared/src/htmlRender.ts: the page bootstrap now haswindow.t3.send(text, data). It posts at3/sendrequest to the parent frame (web) or toReactNativeWebView(mobile) and resolves or rejects on the host's reply.readHtmlRenderSendRequestchecks and formats the request (8000 character limit, data must be JSON).HTML_RENDER_GUIDEholds the guide: when to use a page, layout, theme tokens, look, accessibility, no emojis, and the reply API.apps/server/src/mcp/toolkits/html: new read-onlyhtml_guidetool that returns the guide and a key.html_renderrequires that key asguide, so a model cannot publish before it reads the current guide (the key is a hash of the guide text). Without the key, Haiku skipped the guide and made a white page with gradients. The theme and layout rules moved out of thehtml_renderdescription.:root:root, so a page that copies the theme variables into its own:rootcannot override them. Haiku did that and got a light page in dark mode.orchestrationInstructions.ts: "diagram or clickable steps" is now "diagram".apps/server/src/provider/agentContextBudget.json:mcpToolListJsonBytes47522 to 46817,claudeSystemAppendBytes5138 to 5119,codexAdditionalContextBytes6868 to 6849.BrowserDocumentFrame.tsx,HtmlRenderFrame.tsx,HtmlRenderDialog.tsx,TimelineAssistantRows.tsx): the frame answerst3/sendwith the same gate as links (frame has focus and the user just clicked or typed in it), one send at a time, then calls the existingonSendAppMessage, which queues a user message. Works inline and in the full screen dialog.HtmlRenderWebView.tsx): a WebView cannot prove a user click, so T3 Code asks before each message (the same as MCP apps do), then queues it through the thread outbox.html_guide.docs/user/html-renders.md: one paragraph on reply controls.Tests
vp run check:changed: all checks pass (format, lint, knip, typecheck, tests, react compiler).BrowserDocumentFrame.browser.test.tsx, new case: the page cannot readparent.documentorlocalStorage, at3.sendwithout a click is refused and sends nothing, and a real click in the frame sends the formatted text once. The case fails when the click gate is removed.packages/shared/src/htmlRender.test.ts, new case: text trimming, data as a JSON block, refusals for empty text, too long text, and data that is not JSON.core.test.ts: thehtml_rendercase now also checks that a wrong key is refused and that the key fromhtml_guideworks.:root{--background:...}does not override the T3 token. It fails without:root:root.AgentContextBudget.test.ts,ClaudeAdapterV2.test.tspass.evals/mcp-tool-use) were not run: no API keys on this machine.Scope affected
html_renderpages on web, desktop, and mobile, and the T3 MCP tool list. MCP apps and theirui/messagepath are not changed. Shared guest pages cannot send (no send handler there). Pages published before this change have not3.send, because the bootstrap goes in at publish time.Reasoning
html_renderand did not add arender_uitool. Sandbox (opaque origin, noallow-same-origin), theme injection with live theme changes, height fitting, and persistence as a thread attachment already exist there.html_render(remote URLs load). The opaque origin keeps the page out of the app session.Summary by cubic
HTML pages rendered in threads can now send replies back to the thread. A page calls
t3.send(text, data)and the text, with optional JSON data as a block, goes in as an ordinary user message that starts the next turn.html_guideMCP tool, andhtml_rendernow requires the key it returns, so agents must callhtml_guidebefore their first page.:rootcopies.t3.send, because the bootstrap goes in at publish time.Written for commit 9b49ae2. Summary will update on new commits.