Title generation model switching not working
I am using runtimeContext/dynamic stuff to set the title generation model in threads/memory on an agent and looking at my logs it is ALWAYS using the same model as the agent itself and never even calling my function that sets the model. Example code:
getTitleModel has logging/tracing inside it and it never gets called
7 Replies
Hi @Ferreo ! Thanks for reporting this bug!!
📝 Created GitHub issue: https://github.com/mastra-ai/mastra/issues/8867
GitHub
[DISCORD:1427654090757902437] Title generation model switching not ...
This issue was created from Discord post: https://discord.com/channels/1309558646228779139/1427654090757902437 I am using runtimeContext/dynamic stuff to set the title generation model in threads/m...
@Ferreo I can't reproduce this, it looks like I am able to use runtime context to switch the model. I see in the code you provided you're not actually passing
runtimeContext
into your genTitleModel
function, could that be why the model is always the same? Does that fn return a deafult model?No it was originally running off the runtime context value
And it made no difference
The model getting used is only set as the model for the agent nowhere else
And it's not even calling the function
If it helps this is nextjs not Mastra server
Are you able to provide a repro? That would help a lot!
Hey @Ferreo ! Can you make sure you're setting the memory option when calling
generate/stream
?
If that still doesn't work, as Daniel mentioned, please provide a minimal repro example. Thanks 🙏Looks like the last release fixed this somehow, feel free to close and thanks!