Skip to content

Fix initial WebSocket connect after sync init#42

Open
d180 wants to merge 2 commits into
secureagentics:mainfrom
d180:fix/ws-connect-after-sync-init
Open

Fix initial WebSocket connect after sync init#42
d180 wants to merge 2 commits into
secureagentics:mainfrom
d180:fix/ws-connect-after-sync-init

Conversation

@d180

@d180 d180 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix the SDK WebSocket startup path when adrian.init() runs before an event loop exists. The first async send now starts the initial background connect task instead of buffering frames forever, and a regression test covers the sync-init case.

Solves #41

Test plan

  • Reproduced the bug locally: sync adrian.init(...) left _connect_task=None, and first async send only buffered the frame
  • Verified the fix locally with the same startup pattern: first async send now creates the background connect task
  • sdk/.venv/bin/python -m py_compile sdk/adrian/ws.py sdk/tests/test_init.py
  • Full pytest suite pass locally

Checklist

  • CLA signed (see CLA.md)
  • Tests pass locally
  • Docs updated where needed
  • British English; no em-dashes; no marketing fluff

@yanny-sec

Copy link
Copy Markdown
Contributor

The test is failing. Could you address that? Otherwise looks fine

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.

2 participants