Skip to content

Adopt AI SDK UI message conventions - #3

Merged
scottopolis merged 1 commit into
mainfrom
refactor/ai-sdk-ui
Sep 24, 2026
Merged

scottopolis merged 1 commit into
mainfrom
refactor/ai-sdk-ui

Conversation

@scottopolis

Copy link
Copy Markdown
Owner

Summary

  • replace the custom message, hook, and NDJSON transport with AI SDK UIMessage, useChat, DefaultChatTransport, and standard SSE UI streams
  • inject the language model into createChatServer and run provider-backed tools through ToolLoopAgent with configurable max steps
  • retain server-authoritative conversation/tool history and strip MCP _meta from model input while preserving it for MCP Apps
  • adopt pinned AI SDK MCP helpers and the experimental React renderer without weakening capability, origin, CSP, or app-tool authorization
  • preserve mock mode, standalone/embed demos, and the local Streamable HTTP MCP fixture

Verification

  • npm test (27 tests)
  • npm run build
  • npm audit (0 vulnerabilities)
  • browser: mock chat, MCP counter 3→4, same-origin embed, authorized three-origin embed, unauthorized-origin fallback, 390px responsive layout

Live provider mode was not exercised because no provider call was required for this credential-free verification.

Replace the custom chat protocol with useChat, standard UI streams, and ToolLoopAgent while preserving secure MCP Apps behavior and authoritative server history.

Amp-Thread-ID: https://ampcode.com/threads/T-01a0d522-4096-701d-9ec9-9f2cccf5cd9a
Co-authored-by: Scott Bolinger <designbyscott@gmail.com>
@scottopolis
scottopolis merged commit bede21c into main Sep 24, 2026
1 check passed
@scottopolis
scottopolis deleted the refactor/ai-sdk-ui branch September 24, 2026 21:23
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.

2 participants