feat: hub WebSocket client + execution handling + proxy routes#51
Merged
feat: hub WebSocket client + execution handling + proxy routes#51
Conversation
- Hub WS client: connects to hub with Supabase JWT + machineId, handles WsExecuteRequest (finds agent, starts run, streams events back as WsRunEvent/WsRunStateChange), WsCancel, WsSendInput - Hub sync: now connects WS after registration, reconnects on disconnect. Processes pending commands (cancel/input) from heartbeat response. - Hub proxy routes: GET /api/hub/machines, GET /api/hub/agents, POST /api/hub/runs — daemon proxies CLI requests to hub API - Hub client: added createRun, cancelRun, sendRunInput methods - Updated server test: replaced auth/callback placeholder with hub proxy 401 test - 131 tests passing (2 new: hub-ws creation, hub proxy auth check)
|
🎉 PR Validation ✅ PASSED Commit: Checks:
Ready to merge! ✨ 🔗 View workflow run |
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.
Summary
Daemon-side WebSocket connection to hub for remote agent execution.
WsExecuteRequest→ finds local agent, starts run via run-manager, subscribes to events, streamsWsRunEvent+WsRunStateChangeback to hubWsCancel→ cancels local runWsSendInput→ sends input to waiting runGET /api/hub/machines,GET /api/hub/agents,POST /api/hub/runs— daemon proxies CLI requests to hub API. Returns 401 when not logged in.createRun,cancelRun,sendRunInputmethodsExecution flow
Test plan
npm run verifypasses (type-check + lint + format + 131 tests + build)