Skip to content

Conversation

@threepointone
Copy link
Contributor

In Cloudflare Workers / the workerd runtime, process can be defined, but process.on() isn't (yet). This adds a check for the existence of process.on as a function before handing event handlers.

(Hi folks! I'm a tech lead on ai agents at Cloudflare. Big fan of y'all! Working on making this package work with all our stuff. There's a separate issue with the node build of debug being loaded, but I don't yet think that's a problem with this package. Working on fixing that separately.)

In Cloudflare Workers / the workerd runtime, `process` can be defined, but `process.on()` isn't (yet). This adds a chck for the existence of `process.on` as a function before handing event handlers.
Copy link
Collaborator

@dkundel-openai dkundel-openai left a comment

Choose a reason for hiding this comment

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

Thanks for the fix! Looks good overall. Could you run pnpm changeset to generate a changeset entry? Will try to get this out ASAP

@dkundel-openai
Copy link
Collaborator

Btw there is a dedicated test for Cloudflare in the integrations-test/ happy to adapt this with some expert feedback

@threepointone
Copy link
Contributor Author

done! btw you can add the changeset bot https://github.com/apps/changeset-bot which adds a comment on a pr if it's missing a changeset (and gives a link to autogenerate one) It looks like this cloudflare/agents#316 (comment)

@threepointone
Copy link
Contributor Author

I've started experimenting here https://github.com/threepointone/openai-cloudflare-agents I'll keep you in the loop. For now, trying to figure out why debug's node build gets inserted into the build... I'll get back to you on this.

@dkundel-openai
Copy link
Collaborator

Thanks! Yeah waiting for the bot to be added :)

@dkundel-openai dkundel-openai merged commit a2979b6 into openai:main Jun 4, 2025
4 checks passed
@seratch seratch added bug Something isn't working package:agents-core labels Jun 4, 2025
@threepointone threepointone deleted the process-on-check branch September 3, 2025 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working package:agents-core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants