-
Notifications
You must be signed in to change notification settings - Fork 194
Closed
Description
Hi Team,
Environment
- AI SDK Version: v6.0.0-beta.101
- Framework: Next.js 15.5.6
- Error Location:
process-ui-message-stream.ts:654:25
Problem
When using ToolLoopAgent with message history, message conversion fails:
const agent = new ToolLoopAgent({
model: userProvider.languageModel('claude-haiku-4'),
instructions: 'You are a helpful assistant.',
tools
});
const uiMessages = [...previousMessages, newMessage];
const modelMessages = convertToModelMessages(uiMessages);
const result = await agent.stream({ messages: modelMessages });
Error:
Cannot read properties of undefined (reading 'type')
at process-ui-message-stream.ts:654:25rAgent,
messages, // Should accept UIMessage[] directly
});
Actual Behavior
convertToModelMessages()throws undefined errors on message.parts- Even with validation, stream fails
- Messages work fine with
streamTextbut not with agents
Missing Features
Compared to @ai-sdk-tools/agents (for AI SDK v5), v6 ToolLoopAgent is missing:
- ❌
handoffs: [Agent[]]- Multi-agent orchestration with automatic delegation - ❌
matchOn: string[] | RegExp[]- Instant pattern-based routing (0ms, no LLM call) - ❌ Automatic agent-status events - Streams
{"type":"agent-status"}for UI updates - ❌ Memory provider integration -
memory: { provider, workingMemory, history } - ❌ Stable message handling - Messages that work with streamText fail with agents
Thanks
monobyte and ldriss
Metadata
Metadata
Assignees
Labels
No labels