Weird behaviour depending on the agent property named in mastra instance
I have no idea what is happening. Just 2 minimal example.
This works:
This fails:
11 Replies
with following error:
The only difference is
agents: { gitlabAgent }, vs agents: { coreAgent: gitlabAgent },
It costed me hours of struggling 🙁
Also not happens if I switch to provider with a model not complaining about temperature and top_p defined at the same time. So bedrock part is also important here
reproduced with all latest ATM:
related issue about sonnet 4.5 in bedrock
https://github.com/RooCodeInc/Roo-Code/issues/8377
GitHub
[BUG] Sonnet 4.5 cannot both be specified for this model error mess...
Problem (one or two sentences) When trying to invoke Sonnet 4.5 under Bedrock API, get error message "Sonnet 4.5 cannot both be specified for this model error message". Not sure if it hap...
📝 Created GitHub issue: https://github.com/mastra-ai/mastra/issues/8704
GitHub
[DISCORD:1425823514170101831] Weird behaviour depending on the agen...
This issue was created from Discord post: https://discord.com/channels/1309558646228779139/1425823514170101831 I have no idea what is happening. Just 2 minimal example. This works: import { Mastra ...
Hmm, that seems tricky. I don't have access to bedrock, but I did try creating a provider middleware to see if there's a difference in what is being sent to the API and could not see anything different. Do you see anything on your end if you use the code below?
@Romain I think the problem is that mastra uses agent property key to address agents.
If you check playground you may note that
http://localhost:4111/agents/<agent-name> and in sidebar under "Copy Agent ID for use in code" button match property that was used to register the agent and don't match id property defined during agent creation
So my working example is seems to be side effect and we have 2 separate issues.
One is unsupported set of providerOptions for bedrock sonnet 4.5 as in similar ticket for roo code
Another is mismatches in retrieving agents in internals based on different id sources
@Romain I see you use generate right in script, while I was starting stream from playground.
checking locally with middleware
Yes, I can confirm that issue exist only for playground initiated requests both generate and stream
and playground has no ability to avoid passing these values
I can go with middleware as workaround for now, though I'd take a much closer look to the way id's of agents determined internally
and playground has no ability to avoid passing these valueswrong statement. sorry. there is actual way, though not obvious

as I said previously it seems with my "working" solution was because playground defined properties were not applied to the agent due to mismatch caused by property renaming
Got it, yeah, that makes sense, I understand why you were getting this weird behavior. I'm going to update the GH issue to explain that this issue occurs when using the agent through the playground. Thanks for finding out this issue!
What about agent id sources?
Actually, I'm not able to reproduce. If I register my agent like this
agents: { weatherAgent }, change the temperature in the playground, then I see the updated temperature being sent to the api. Then I tried doing it this way agents: { core_agent: weatherAgent }, changed the temperature and still was able to see the correct temperature being sent to the api. 🤔can you confirm that agentId you see in playground derived from agents property name in your case?
similar issue with workflow being addressed by the property used in tools configuration property:
https://discord.com/channels/1309558646228779139/1428295168565448755