Repository navigation
feat(app): add generative UI to the GUI - #54747
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
The genui skill now covers when a surface beats text and how it fits a turn, and its description says when to load it.
Text is the default. The skill gives a three-part test, lists what never gets a surface, and caps surfaces at one per answer; the skill description, tool description and in-app reminder say the same before the skill loads.
3 of 6 tasks
1 task done
|
+1 this, when will it become officially experimental? it's not in v2.2.5 so far |
1 task done
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.
Agents can now show interactive UI in the timeline. They write a small GenUI program in a
genui_rendercall; the app draws it with OpenCode's own components while the call streams, and every call is checked so the agent knows whether its UI rendered. It is on by default, and Settings > Experimental > Generated UI turns it off.genui-dataviz.mp4
The demo telemetry is synthetic.
How it works
publish-llm-event.tspublishessession.tool.input.deltathrough the same batching as text and reasoning, and flushes held tool input before the next block starts. The event, the client reducer, the TUI and the CLI already handled it. Schema and the rest of Core are unchanged.metadata.genui, from the Generated UI setting. The plugin removesgenui_renderfrom requests whose latest prompt did not saytrue, such as a terminal, a subagent or the setting turned off, and adds a short reminder when that changes, the way Plan mode reminds. No RPC, polling or permission writes.The language
null, lists and objects.$namestate lives in the app. Expressions (+ - * / %, comparisons,&& || !,? :) read it;set,reset,replyandopenrun when the user presses a button. There are no loops, functions or host access.genuiskill prints typed signatures from it, e.g.Metric(label: string, value: string | number, detail?: string, delta?: number, trend?: number[], inverse?: boolean).genuiskill whenever it is enabled. Besides the syntax, components and examples, it keeps generated UI rare: text is the default, a surface must clearly beat text, a list names what never gets one, and an answer gets at most one. It also tells the agent to gather data before rendering, to end the turn after a surface that asks for a choice, and what a reply looks like. Its description says to load it before the firstgenui_rendercall. The skill description, the tool description and the in-app reminder also say that text is the default, so the agent knows before it loads the skill.What the agent gets back for a broken program:
Why our own language
The syntax follows OpenUI Lang, but we dropped
@openuidev/lang-core:@openuidev/lang-core0.4.1@opencode/coreand@opencode/sdkChanges
core: tool input deltas, as above, with tests for batching and ordering.@opencode/plugin-genui:lang/: lexer, incremental parser, evaluator and checks, generic over a catalog.catalog.ts: components and examples.guide.ts: thegenuiskill.tools.ts:genui_render.session.ts: app-only offering and the reminder../genui,./langand./catalogare browser-safe entry points.@opencode/plugin-browser: a built-inbrowserskill: explicit tab IDs, snapshots and refs, showing results to the user, recipes for debugging, performance and memory, recovery after failures, and every operation fromBrowser.Operations. It is gated like the browser tools: hidden until a desktop browser attaches to the session.session-ui:genui/renders surfaces, charts, state and actions.genui_renderreads arguments while they stream; every other tool still waits for complete input.DataProvidergainsonPromptfor replies.app:metadata.genuifrom that setting.onPrompt.Components
Surface,Section,ColumnsText,Markdown,Code,Divider,Notice,StatusMetrics/Metric(sparkline, delta),Progress,BarList,Table,Steps,Group/RowBarChart(grouped or stacked),LineChart,AreaChart(stacked),ComboChart(two axes),ProjectionChart(target line),DonutChart,ShareBar,RadarChart,ScatterChart,HeatmapMeter,Gauge,Pips,StatusStrip,ComparisonActions,Button,Link,Form,Input,TextArea,Select,Choice,Segmented,Toggle@opencode/uiand--v2-*tokens. One series uses the text color; several use--genui-series-1..6from v2 hue steps; state colors mean outcomes only.Follow-ups
en-US; it should follow the app locale.