MastraM
Mastra4mo ago
Omar

Supervisor Agent failing to invoke underlying agents

The Problem

My workflow is invoking the supervisor agent as a workflow step [The agent is using gpt-4o] and this agent is supposed to route/invoke the right specialized agent, however the supervisor agent is throwing error that use streamVNext, I am guessing mastra is internally using stream which is causing this error, since nowhere I am explicitly invoking the specialized agents.

What's Happening

  1. You create a workflow that includes an supervisor agent step
  2. The workflow runs and reaches the agent step
  3. Mastra's execution engine tries to stream the agent's response using the old Agent.stream() method
  4. AI SDK V2 rejects the legacy streaming method and throws an error
  5. The entire workflow fails and stops execution
## Error
V2 models are not supported for stream. Please use streamVNext instead. { modelId: 'gpt-4o' }
Error executing step supervisor-router-agent: Error: V2 models are not supported for stream. Please use streamVNext instead.
Was this page helpful?