You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dashboard: session-stream span 404s when the session key contains ':' #5160
When a chat session's key contains : characters, opening its sessions.pipe() span in the run inspector shows "Error: 404 Could not subscribe to stream", and the panel header shows only the last segment of the key (e.g. Session: v2.out). The stream itself is fine: the SDK reads and writes it, and read_session_channel (MCP) returns its records.
Reproduction
Define a chat.agent with a custom channel whose key contains colons, e.g. key: "clerk:{event.userId}:v2".
Send a message so a turn runs.
Open the run in the dashboard and click the sessions.pipe() span.
Expected: the session's .out stream renders. Actual: the panel shows Session: v2.out and "404 Could not subscribe to stream". The webapp logs show the request for the truncated id:
GET /resources/orgs/<org>/projects/<project>/env/prod/sessions/v2/realtime/v1/out 404
while the SDK's own requests for the same session succeed:
PUT /realtime/v1/sessions/clerk%3Auser_XXXX%3Av2/out 202
GET /realtime/v1/sessions/clerk%3Auser_XXXX%3Av2/out/records 200
Cause
SpanPresenter.server.ts (case "session-stream") splits the span entity id on : and indexes from the end:
Because the session id (an external id / channel key) can itself contain :, a key like clerk:user_XXXX:v2 is reduced to sessionId = "v2", and the route then requests /sessions/v2/realtime/v1/out, which 404s. This is present in v4.8.4 and on main.
Suggested fix
Parse io and channel from the end and join the remainder as the session id (parts.slice(0, -2).join(":")), or encode the session id when building the entity id.
Activity