feat(cli): scaffold selected backend framework - #785
Open
vishxrad wants to merge 20 commits into
Open
Conversation
vishxrad
marked this pull request as ready for review
July 16, 2026 14:56
vishxrad
force-pushed
the
visharad/th-2051-route-replacement
branch
from
August 4, 2026 10:04
92faf00 to
dcbc7d3
Compare
…e-replacement # Conflicts: # packages/openui-cli/src/templates/openui-cloud/package-lock.json # packages/openui-cli/src/templates/openui-self-hosted/package-lock.json
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
abhithesys
reviewed
Aug 5, 2026
abhithesys
left a comment
Contributor
There was a problem hiding this comment.
use adapters on frontend for message transformation and framework native streaming
…e-replacement # Conflicts: # docs/content/docs/agent/reference/adapters-and-formats.mdx # packages/openui-cli/src/commands/create-app.ts # packages/openui-cli/src/lib/utils.ts # packages/react-headless/src/stream/adapters/__tests__/vercel-ai-sdk.test.ts # packages/react-headless/src/stream/adapters/vercel-ai-sdk.ts # pnpm-lock.yaml
AbhinRustagi
reviewed
Aug 6, 2026
| "@openuidev/react-lang": "^0.2.10", | ||
| "@openuidev/lang-core": "0.2.11", | ||
| "@openuidev/react-lang": "^0.2.11", | ||
| "@openuidev/react-ui": "^0.13.4", |
Contributor
There was a problem hiding this comment.
Can you also update this to ^0.13.5 and similarly in the other template
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
src/app/api/chat/route.tsandsrc/app/page.tsxfor framework-backed variants so each route uses its matching frontend adapter and message formatget_weatheras the diagnostic app-owned tool in every framework-backed scaffoldToolMessageresults in the frontend adapter so multi-step history remains validFramework behavior
Self-hosted
none: OpenAI SDK Chat Completions route + OpenAI frontend adapter/message formatlanggraph: inlineStateGraphreturnsgraph.stream(..., { encoding: "text/event-stream" }); the frontend useslangGraphAdapter()andlangGraphMessageFormatvercel-ai-sdk:streamText()returnstoUIMessageStreamResponse(); the frontend usesvercelAIAdapter()andvercelAIMessageFormatOpenUI Cloud
OpenUI Cloud remains the Responses provider and the sole conversation/artifact store for every Cloud variant. Choosing a framework changes the app-owned tool runtime and browser wire protocol; it does not move Cloud-owned tools onto the app server or configure a second model provider.
none: OpenAI SDK Responses stream +openAIResponsesAdapter()langgraph:ChatOpenAI({ useResponsesApi: true })points at OpenUI Cloud, an inlineStateGraphruns app tools throughToolNode, and LangGraph encodes the named-event SSE consumed bylangGraphAdapter()vercel-ai-sdk: the AI SDK OpenAI Responses provider points at OpenUI Cloud,streamText()executes app tools, andtoUIMessageStreamResponse()produces the UIMessage SSE consumed byvercelAIAdapter()Both Cloud framework routes send only the latest new user/tool message into the stored Cloud conversation. Cloud-owned calls are excluded from the local framework executor, while app-owned calls such as
get_weatherare executed locally and submitted back to that same Cloud conversation.Choose the self-hosted template when using a user-owned model provider.
Dependency notes
ai@6.0.244and@ai-sdk/openai@3.0.90. The newer6.0.246/3.0.91registry entries currently depend on unpublished@ai-sdk/provider-utils@4.0.42(and@ai-sdk/gateway@3.0.166), so caret ranges make a fresh install fail.ToolMessageordering fix in this PR uses React Headless0.9.7; that package must be published before the CLI release so generated LangGraph apps can install it from the registry.@openuidev/react-uire-exports the adapters, so generated React UI code imports them only from React UI.LangChain package note
@openuidev/langchaintargets a separate LangGraph protocol-v2 server and requires an API URL, assistant ID, agent-side stream transformer, and a second process/deployment. The CLI LangGraph option remains an inlineStateGraphin the Next.js route, so adopting that package would require a separate scaffold topology rather than a route/page replacement.Issue
TH-2051 — Ask for backend framework in CLI
Validation
main(8c6ffd88; zero commits behind at push time)pnpm --filter @openuidev/cli buildpnpm --filter @openuidev/cli run cipnpm --filter @openuidev/react-headless test(16 files, 155 tests; previous adapter validation)0.9.7)