dynamic agents - throwing in `instructions`
I use dynamic agents and throw inside 
instructions function if runtimeContext is not valid. Because of it, I can't initialize mastra dev, on some reasons on initializing it tries to call agent.generate() (with empty runtimeContext obviously) and fails.. Is that an issue to post or I'm doing something wrong?3 Replies
📝 Created GitHub issue: https://github.com/mastra-ai/mastra/issues/6004
GitHub
[DISCORD:1394297453288755241] dynamic agents - throwing in `instruc...
This issue was created from Discord post: https://discord.com/channels/1309558646228779139/1394297453288755241 I use dynamic agents and throw inside instructions function if runtimeContext is not v...
Hi @dashan108 we require the dynamic function to return the value. You will need to catch and return empty string in a dev environment vs production
Throwing in those dynamic functions are not advised.
ok, understood!