Skip to content

feat(cli): add OpenUI Cloud LangGraph and Vercel AI SDK backends - #969

Open
AbhinRustagi wants to merge 1 commit into
be-framework-self-hostedfrom
be-framework-cloud
Open

feat(cli): add OpenUI Cloud LangGraph and Vercel AI SDK backends#969
AbhinRustagi wants to merge 1 commit into
be-framework-self-hostedfrom
be-framework-cloud

Conversation

@AbhinRustagi

@AbhinRustagi AbhinRustagi commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

What

Adds the LangGraph and Vercel AI SDK backend overlays for the Cloud template. In both, the framework owns orchestration and application tools while OpenUI Cloud stays the Responses model provider and conversation store — reports, presentations, web search, image search and MCP remain provider-executed.

Changes

  • LangGraphsrc/agent/agent.ts builds the agent with createAgent() plus a middleware that points the model at Cloud, forwards only the newest message (Cloud holds the history), and strips Cloud-owned tool calls from graph state so ToolNode runs only app tools.
  • Vercel AI SDK — a streamText() route with middleware that marks Cloud-executed tools as provider-executed, so the SDK streams them without dispatching them locally, plus a UI-chunk transform that makes completed Cloud tools display-only in the browser.
  • Each overlay ships its own cloud-chat.tsx wired to the transport its route speaks — agUIAdapter() for LangGraph, vercelAIAdapter() + vercelAIMessageFormat for the AI SDK. The base template is untouched, so there's no transport map or backend prop to keep in sync as backends are added.
  • Ignore .langgraph_api, written by the local Agent Server.

Pure additions — this PR modifies no existing template file.

Test Plan

  • Verified locally

Built the CLI and scaffolded all three Cloud variants. Each gets the right adapter in its generated cloud-chat.tsxagUIAdapter, vercelAIAdapter, and openAIResponsesAdapter for default — with no backend prop and no transport map anywhere. Also confirmed src/lib/tool-loop.ts is removed via files.remove and backends/ doesn't leak.

Checklist

@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openui-docs Ready Ready Preview Aug 14, 2026 11:19am

Request Review

@AbhinRustagi
AbhinRustagi marked this pull request as ready for review August 13, 2026 11:57
Add the two backend overlays for the Cloud template. In both, the
framework owns orchestration and application tools while OpenUI Cloud is
attached as the Responses model provider and conversation store; reports,
presentations, web search, image search, and MCP stay provider-executed.

- LangGraph: `src/agent/agent.ts` builds the agent with `createAgent()`
  and a middleware that points the model at Cloud, forwards only the
  newest message (Cloud holds the history), and strips Cloud-owned tool
  calls from graph state so ToolNode runs only app tools. `/api/chat`
  proxies to the Agent Server via `@openuidev/langchain`.
- Vercel AI SDK: a `streamText()` route with middleware that marks
  Cloud-executed tools as provider-executed so the SDK streams them
  without dispatching them locally, and a UI-chunk transform that makes
  completed Cloud tools display-only in the browser.
- Each overlay ships its own `cloud-chat.tsx` wired to the transport its
  route speaks — `agUIAdapter()` for LangGraph, `vercelAIAdapter()` plus
  `vercelAIMessageFormat` for the AI SDK. The base template keeps its
  `openAIResponsesAdapter` version untouched, so there is no transport
  map or `backend` prop to keep in sync as backends are added.
- Ignore `.langgraph_api`, written by the local Agent Server.

Migrated from PR #785 (visharad/th-2051-route-replacement).

Co-Authored-By: Visharad Kashyap <154831195+vishxrad@users.noreply.github.com>
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