Remote agent client — thin wrapper around LangGraph's RemoteGraph.
Delegates streaming, state management, and SSE handling to
langgraph.pregel.remote.RemoteGraph. This wrapper converts streamed message
dicts into LangChain message objects for the app's Textual adapter, but leaves
state snapshots in the server's serialized form.
Best-effort error-type name for an exception from RemoteAgent.astream.
The LangGraph server serializes non-allowlisted exceptions as
{"error": <ExceptionType>, "message": ...} wrapped in
RemoteException(payload) (see langgraph_api.serde). The server-reported
"error" type is the authoritative name when present; otherwise the
exception's own class name is used. This is the single source of truth for
"what error did the stream report" — both format_agent_exception (display
string) and the UI's error-enrichment path (error-type dispatch) read it.
Render an exception from RemoteAgent.astream for the UI.
The LangGraph server serializes non-allowlisted exceptions as
{"error": <ExceptionType>, "message": <text or "An internal error occurred">}
(see langgraph_api.serde). RemoteGraph wraps that dict in
RemoteException(payload), so the default str(exc) renders as an ugly
Python dict repr in the UI.