Skip to content

fix: unpack and set agents as promise, to avoid delaying runtime instantiation - #2656

Merged
ranst91 merged 2 commits into
feat/cpk-1.5from
v1.5/fix-agent-resolving
Oct 24, 2025
Merged

ranst91 merged 2 commits into
feat/cpk-1.5from
v1.5/fix-agent-resolving

Conversation

@ranst91

@ranst91 ranst91 commented Oct 24, 2025

Copy link
Copy Markdown
Contributor

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

@vercel

vercel Bot commented Oct 24, 2025 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs Ready Ready Preview Comment Oct 24, 2025 9:09am
examples-coagents-ai-travel-app Ready Ready Preview Comment Oct 24, 2025 9:09am
examples-coagents-research-canvas-ui Ready Ready Preview Comment Oct 24, 2025 9:09am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
examples-coagents-ai-researcher-ui Ignored Ignored Oct 24, 2025 9:09am

@changesets-bot-copilotkit

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 061aeed

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@copilotkit/runtime Patch
@copilotkit/runtime-client-gql Patch
@copilotkit/react-core Patch
@copilotkit/react-textarea Patch
@copilotkit/react-ui Patch
@copilotkit/sdk-js Patch
@copilotkit/shared Patch

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Oct 24, 2025

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch v1.5/fix-agent-resolving

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

This branch was successfully deployed

3 active deployments
Preview – docs — 061aeed4 Deployed Oct 24, 2025 by vercel[bot]
Preview – examples-coagents-research-canvas-ui — 061aeed4 Deployed Oct 24, 2025 by vercel[bot]
Preview – examples-coagents-ai-travel-app — 061aeed4 Deployed Oct 24, 2025 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant