fix bridge first-turn disconnect during Hermes bootstrap

This commit is contained in:
Jack
2026-10-22 15:28:44 +08:00
parent 99e5687ce0
commit ce76dffa84
3 changed files with 68 additions and 1 deletions
@@ -0,0 +1,19 @@
---
date: 2026-10-22
feature: Agent Bridge startup
impact: Prevent first-turn connection loss during Hermes interpreter relaunch
commit: pending
---
# Initialize Hermes before Bridge readiness
- Commit: pending local validation.
- Feature: Agent Bridge process startup, first chat/context estimate.
- Cause: importing run_agent after the worker socket was ready invoked Hermes bootstrap, which execed from the selected dependency venv into managed Python and dropped the in-flight request.
- Change: run Hermes bootstrap in the manager launch command before starting the broker. Workers inherit the selected interpreter; vendored Python and Socket.IO contracts remain unchanged.
- Validation: focused manager and bridge tests, cold-worker context estimates and first chat, production build.
## Results
- Harness and full production build passed.
- Focused manager/concurrency suite: 54 passed; two pre-existing no-source tests also fail unchanged on this host because a global Hermes checkout exists.
- Cold magic-conch and snowy-owl context estimates succeeded; the first snowy-owl chat completed with OK.
- Focused browser chat streaming test passed with one worker. Broad parallel browser run: 3 passed, 8 input-locator failures; no client code changed.