Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

whoiskatrin
Copy link
Collaborator

No description provided.

Copy link

changeset-bot bot commented Oct 8, 2025

🦋 Changeset detected

Latest commit: f3bbd71

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

This PR includes changesets to release 1 package
Name Type
agents Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link

pkg-pr-new bot commented Oct 8, 2025

Open in StackBlitz

npm i https://pkg.pr.new/cloudflare/agents@544

commit: f3bbd71

@dnyg
Copy link

dnyg commented Oct 9, 2025

I think these are some good solid improvements, and the remaining problems all lie in the import of @modelcontextprotocol/sdk because it utilizes the ajv library that is taking up most of the startup time at this point
Screenshot 2025-10-09 at 09 01 50

@whoiskatrin whoiskatrin marked this pull request as ready for review October 9, 2025 07:39
@whoiskatrin whoiskatrin changed the title Startup time opt Startup time improvements Oct 9, 2025
packages/agents/src/mcp/client.ts Outdated Show resolved Hide resolved
packages/agents/src/observability/index.ts Outdated Show resolved Hide resolved
packages/agents/src/ai-chat-agent.ts Outdated Show resolved Hide resolved
packages/agents/src/ai-chat-agent.ts Outdated Show resolved Hide resolved
packages/agents/src/ai-chat-agent.ts Outdated Show resolved Hide resolved
packages/agents/src/ai-chat-agent.ts Outdated Show resolved Hide resolved
packages/agents/src/index.ts Outdated Show resolved Hide resolved
packages/agents/src/lazy-loader.ts Outdated Show resolved Hide resolved
packages/agents/src/mcp/client.ts Outdated Show resolved Hide resolved
packages/agents/src/ai-chat-agent.ts Outdated Show resolved Hide resolved
packages/agents/src/ai-chat-agent.ts Show resolved Hide resolved
packages/agents/src/index.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@threepointone threepointone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approving

an unfortunate failure case is that anyone importing ai themselves in app code might defeat this optimisation

we should still push on proper fixes to zod/ajv

but glad this should unblock some people

packages/agents/src/ai-chat-agent.ts Outdated Show resolved Hide resolved
packages/agents/src/ai-chat-agent.ts Outdated Show resolved Hide resolved
@whoiskatrin whoiskatrin merged commit afd9efd into cloudflare:main Oct 10, 2025
3 checks passed
@whoiskatrin whoiskatrin deleted the startup-time-opt branch October 10, 2025 16:16
@threepointone threepointone mentioned this pull request Oct 10, 2025
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.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.