OpenAI SDK v5 removed beta.chat (promoted to chat.completions) and
changed multi-path-param methods to use named params (e.g.
runs.retrieve(runId, { thread_id }) instead of positional args).
- Add isOpenAIV5() detection and getChatCompletionsForStreaming() helper
- Migrate OpenAIAdapter to use helper for streaming completions
- Migrate OpenAIAssistantAdapter runs.retrieve() and
submitToolOutputsStream() to branch on SDK version
- Add openai ^4.85.1 || ^5.0.0 to peerDependencies
The V1 CopilotRuntime constructor did `{...endpointAgents, ...agents}`
which silently spread a factory function to `{}`, losing all agents.
Anyone using the V1 API with a factory function got zero agents and no
error. This wraps factory functions so endpoint agents are merged at
resolution time instead of construction time.
- Restore getCapabilities() return type to Promise<AgentCapabilities>
with ?? {} fallback, honoring AbstractAgent base class contract
- Simplify type annotation in get-runtime-info.ts to explicit
AgentCapabilities | undefined instead of complex Awaited<ReturnType<...>>
- Add console.warn logging to per-agent capabilities error catch block
- Fix useCapabilities JSDoc to accurately describe behavior during
runtime handshake
- Add test for empty capabilities object {} (truthy, included in response)
- Update error isolation test to verify warning is logged
- Add per-agent error isolation in /info handler so a single
getCapabilities() failure doesn't 500 the whole endpoint
- Normalize getCapabilities() to return undefined (not {}) when no
capabilities are set, matching the sync getter
- Replace instanceof ProxiedCopilotRuntimeAgent with duck-type check
in useCapabilities hook for extensibility
- Add JSDoc warning about shallow-merge behavior on capabilities config
- Add useCapabilities hook tests (5 cases covering both branches)
- Add per-agent error isolation test for get-runtime-info
Add AgentsFactory type that accepts a function receiving request context,
enabling multi-tenant and request-scoped agent configuration. The agents
option now accepts a static record, a Promise, or a factory function.
When mode is null (unknown tool skipped), content_block_delta events
with input_json_delta would still call sendActionExecutionArgs using
the previous valid tool call ID, corrupting its arguments.
extractParametersFromSchema now preserves enum values as structured
data on string parameters, recursively extracts nested object
attributes, and converts object arrays to object[] type with
attributes. This ensures complex MCP tool schemas survive the
Parameter[] -> Zod conversion without losing nested structure.
Parse Retry-After as seconds or HTTP-date and use it as the retry delay
instead of exponential backoff. Throw if the server requests a wait
longer than maxRetryAfterSeconds (60s default) to avoid hanging.
When getLanguageModel() returns null and provider/model are undefined
(as with LangChainAdapter), the code constructed "undefined/undefined"
as a model string, causing a cryptic "Unknown provider" error.
Now checks each source of model info explicitly and throws a clear
error message directing users to provide an explicit agents config
when using adapters that don't expose model metadata.
langchain-mcp-adapters sends tool call result content as an array of
{type:"text", text:string} objects. Extract and join text parts so
downstream consumers always receive a plain string.
GoogleGenerativeAI returns "0" as lc_kwargs.id for every message,
which is truthy and bypassed the randomId() fallback. All streamed
messages then shared the same ID, breaking message deduplication.
Now we always use randomId() for new message streams.
The onAfterRequest middleware callback was being called with an empty
object `{}` instead of the available hook parameters (threadId, runId,
messages, path). Extract and forward these from the hookParams that the
v2 runtime provides.
Providers like @ai-sdk/openai-compatible emit sequential IDs (txt-0,
reasoning-0, msg-0) that collide across requests. The existing check
only caught the literal "0". Expand the check to match the
^(txt|reasoning|msg)-0$ pattern and always use randomUUID() for these.
When @hono/node-server polyfills the Request class, instanceof fails
because the polyfilled object has a different prototype chain.
Replace `reqOrRequest instanceof Request` with a duck-type check
that verifies url, method, and headers properties exist, which
works with both native and polyfilled Request objects.
The hardcoded 1024 default was too restrictive for most use cases,
causing truncated responses. Increase to 4096 as a more reasonable
default while still respecting user-provided maxTokens.
TanStackChatMessage.content uses any[] for multimodal so
messages are directly passable to any adapter without casts.
Add env.d.ts with vite/client types for CSS imports.
- Fix convertInputToTanStackAI silently dropping multimodal
content (images, audio, video, documents) by converting
AG-UI content parts to TanStack AI ContentPart format
- Switch react-router example from Hono server to a React
Router resource route using createCopilotRuntimeHandler
- Both agents now use BuiltInAgent factory pattern
- Remove hono/react-router-hono-server deps from example
The base class @ag-ui/langgraph creates an Observable that calls
runAgentStream() but ignores the returned Promise. Any async rejection
becomes an unhandled promise rejection that crashes the process.
Override run() to properly route async errors through the Observable
error channel so downstream catchError handlers can process them.
- Fix all doc imports to use @copilotkit/runtime/v2 (symbols only
exported from v2 entry point)
- Replace v1 copilotRuntimeNextJSAppRouterEndpoint with v2 pattern
(CopilotRuntime + createCopilotEndpoint + InMemoryAgentRunner)
- Add warning callout on TanStack reasoning example (reasoning events
not surfaced by TanStack converter)
- Fix randomUUID imports in converters: use @copilotkit/shared instead
of Node.js crypto to match codebase convention
- Fix collectEvents timer leak in test-helpers.ts (add clearTimeout)
- Fix JSDoc/comments: convertInputToTanStackAI accurately describes
role allowlist, TanStackInputResult.messages comment updated