Repository navigation
fix: unpack and set agents as promise, to avoid delaying runtime instantiation - #2656
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
🦋 Changeset detectedLatest commit: 061aeed The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Click here if you're a maintainer who wants to add another changeset to this PR |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The way runtime instantiation was done with 1.5 causes a delay/mismatch in agents, due to async nature that is not being resolved properly. This PR provides a fix.
As an explanation:
The runtime we are wrapping expects promise-like agents (or just the agents object) but expects the entire runtime setup to be synchronous.
We were setting up the runtime asynchronously, which caused some issues. The reason why this was done is be able to get MCP tools etc and assign them to the agents. So the agent is basically enriched after the runtime was already being used.
In this PR, since the agents themselves are expected to be promises, we will piggy back on this promise, to fetch tools and so, and assign to agents. So agents will always return a promise, while the entire runtime stays sync