feat(python): add AsyncInkbox awaitable client - #147
Open
ron-42 wants to merge 1 commit into
Open
Conversation
Mirrors sync Inkbox/AgentIdentity for asyncio agents without blocking the event loop (to_thread hop; same public surface).
ron-42
requested review from
alex-w-99,
dimavrem22 and
rayruizhiliao
as code owners
August 9, 2026 20:16
Author
|
Hi, @alex-w-99 @dimavrem22. Kindly review the PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #146
The gap
The Python SDK is sync-only (
httpx.Client). TypeScript is nativelyawait. Async Python agents — FastAPI webhooks, ASGI tunnels, browser-use — wrap every call by hand:Miss one site and the event loop blocks. In-repo examples already do this boilerplate (
examples/use-inkbox-browser-use).What this PR adds
AsyncInkbox/AsyncAgentIdentity— same constructor kwargs and public surface as syncInkbox/AgentIdentity, but awaitable:inkbox.messages,inkbox.vault, …) and nested objects return awaitable proxies.iter_emails, …) are drained off the event loop and returned as lists.inkbox.sync/identity.sync.signup,verify_signup, …) are awaitable onAsyncInkbox.Implementation note. REST still uses the sync client via
asyncio.to_thread, so the event loop does not block without cloning every resource ontohttpx.AsyncClient. True async I/O is a follow-up if thread-pool load becomes a problem (called out in the module docstring). SyncInkboxis unchanged.Verification
Live smoke against a real org (admin key):
whoami,get_identity,send_email(to self),iter_unread_emails,get_message,mark_emails_read,list_identities,messages.list,vault.info— all viaawait.