fix(desktop): relay MCP OAuth through client-local callbacks

This commit is contained in:
Filipe Bezerra
2026-09-07 02:06:53 +00:00
committed by Teknium
parent f83ff89780
commit e3ba651b6d
12 changed files with 652 additions and 355 deletions
+13
View File
@@ -237,6 +237,19 @@ def poll_flow(session_id: str, server_name: str) -> Dict[str, Any]:
return out
def cancel_flow(session_id: str, server_name: str, hermes_home: str) -> Dict[str, Any]:
"""Cancel only the owning profile's flow and release its callback waiter."""
rec, err = _lookup(session_id, server_name)
if rec is None:
return {"ok": False, "error_message": err}
if rec["hermes_home"] != hermes_home:
return {"ok": False, "error_message": "profile mismatch for session"}
flow = rec["flow"]
flow.mark_error("OAuth cancelled by user")
_shutdown_listener(rec)
return {"ok": True, "status": flow.snapshot()["status"]}
def deliver_callback_flow(
session_id: str, server_name: str, *, code: Optional[str], state: Optional[str],
error: Optional[str] = None) -> Dict[str, Any]: