mirror of
https://github.com/andrewyng/openworker.git
synced 2026-09-13 15:50:02 +00:00
port aisuite#380: slack installer pre-add, mcp oauth quarantine, automation toast, e2e fixes
Slack installer joins the workspace allow-list on managed connect; MCP interactive oauth only from explicit connects. Run-started toast over a new app-wide /ws/events socket; Automations e2e locators scoped to the account menu.
This commit is contained in:
@@ -1657,6 +1657,24 @@ def create_app(manager: SessionManager) -> FastAPI:
|
||||
finally:
|
||||
manager.unregister_session_client(session_id, ws.send_json)
|
||||
|
||||
@app.websocket("/ws/events")
|
||||
async def ws_events(ws: WebSocket) -> None:
|
||||
"""App-wide event stream (session-independent): the GUI keeps one open for
|
||||
pushes like automation_run_started (the UX-026 toast). Read-only — inbound
|
||||
frames are ignored; the receive loop just detects disconnect."""
|
||||
if not _origin_allowed(ws.headers.get("origin")):
|
||||
await ws.close(code=1008)
|
||||
return
|
||||
await ws.accept()
|
||||
manager.register_event_client(ws.send_json)
|
||||
try:
|
||||
while True:
|
||||
await ws.receive_text()
|
||||
except WebSocketDisconnect:
|
||||
pass
|
||||
finally:
|
||||
manager.unregister_event_client(ws.send_json)
|
||||
|
||||
return app
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user