Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): bump websocksets to 15+ #3653

Merged
merged 2 commits into from
Mar 27, 2025
Merged

Conversation

0xRAG
Copy link
Contributor

@0xRAG 0xRAG commented Mar 25, 2025

What was wrong?

OpenAI Agents released voice support, but it requires websockets 15+. In AgentKit we use web3.py extensively in our core package. We would like to support OpenAI's voice-enabled agents which is possible only through upgrading web3.py's dependency on websockets.

Related to and closes #3641

How was it fixed?

There are some breaking changes in between websockets 13 and 15, however there are access points for newly deprecated methods and fields. I'm sure the web3.py library would like to take advantage of the improvements to websockets (there is a full upgrade guide here), but for the (admittedly selfish) scope of combining web3.py & AgentKit & OpenAI Agents, this PR should suffice, while being directionally correct.

I tested the changes by installing the latest websockets and running the full test suite via make test. The test results are exactly the same as on main.

References

Todo:

  • Clean up commit history
  • Add or update documentation related to these changes
  • Add entry to the release notes

Cute Animal Picture

image

@0xRAG 0xRAG force-pushed the bump-websockets branch 4 times, most recently from 04da047 to 9073cb1 Compare March 25, 2025 23:13
@0xRAG 0xRAG force-pushed the bump-websockets branch from 9073cb1 to 92dcdfc Compare March 25, 2025 23:16
@fselmo
Copy link
Collaborator

fselmo commented Mar 26, 2025

Thanks @0xRAG. We've discussed this and I think for the purposes of not breaking, we should keep python 3.8 support and remain on a v7 minor release path.

I realized that all breaking changes happen under the _ws private underlying API. So technically we can add a python version check via compat, as I did here, and what actually "breaks" doesn't really break because it was already considered an internal / breakable, non-public, API.

I am going to cherry-pick some of those commits here if you don't mind and we can take a last look together and see if this checks all the boxes.

cc: any and all in #3641

@0xRAG
Copy link
Contributor Author

0xRAG commented Mar 26, 2025

Sounds good thanks @fselmo!

@fselmo
Copy link
Collaborator

fselmo commented Mar 26, 2025

Looks like websockets did a great job backporting these changes. All that was needed in the end was importing from websockets.legacy paths and this is already version agnostic. For now, this is a nice easy change that doesn't break anything. We'll be able to dig in a bit more into new websockets features as a separate scope.

@0xRAG does this work as a first step toward compatibility with no breaking changes 👀 ?

@0xRAG
Copy link
Contributor Author

0xRAG commented Mar 26, 2025

Amazing! Yes, bumping the upper range to include up to websockets 16 should unblock us. Thanks @fselmo! When can we expect this to land in a release?

@fselmo
Copy link
Collaborator

fselmo commented Mar 26, 2025

Amazing! Yes, bumping the upper range to include up to websockets 16 should unblock us. Thanks @fselmo! When can we expect this to land in a release?

It's too late in the day today so I'll try to get a release out as quickly as tomorrow :)

@fselmo fselmo requested a review from kclowes March 26, 2025 22:54
@0xRAG
Copy link
Contributor Author

0xRAG commented Mar 26, 2025

Sounds good!

@fselmo fselmo self-assigned this Mar 26, 2025
@fselmo fselmo requested review from pacrob, reedsa and wolovim March 26, 2025 23:17
@fselmo fselmo merged commit 71778e0 into ethereum:main Mar 27, 2025
85 checks passed
@0xRAG 0xRAG deleted the bump-websockets branch March 27, 2025 17:06
@fselmo
Copy link
Collaborator

fselmo commented Mar 27, 2025

@0xRAG web3.py 7.10.0 was just released with this change!

@0xRAG
Copy link
Contributor Author

0xRAG commented Mar 27, 2025

Amazing, thanks @fselmo!

@0xRAG
Copy link
Contributor Author

0xRAG commented Mar 27, 2025

Confirmed this unblocked us @fselmo! If you're curious, here's a PR in AgentKit bumping web3.py and adding support for the OpenAI voice agent coinbase/agentkit#620

@fselmo
Copy link
Collaborator

fselmo commented Mar 27, 2025

Happy to hear it @0xRAG! Thanks for sharing and glad to have unblocked everyone dependent on this. I think this was a very good example of how to break things by websockets. Quite an elegant and easy path for everyone in the end.

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.

Please upgrade websockets to 15 or at least 14
3 participants