chat/<agentId>/<slug>-<shortId> so a link works across reconnects and never leaks the raw UUID.
Quick Start
1
Build a shareable URL
Turn a runtime session key into a stable URL segment.
2
Parse a path back into a SessionRef
Recover the reference a resolver looks up.
How It Works
A client sends a friendly path; the gatewayβssession.resolve maps it back to a concrete session id.
User interaction flow
A user copies a chat URL from their laptop and pastes it on their phone. The mobile client callssession.resolve with the friendly path; the gateway returns the concrete session id and the same conversation reopens β no raw UUID ever changed hands.
The four addressing forms
Pick the form that matches how much the URL should reveal.Configuration Options
These are pure functions and constants β no config class.
All seven symbols import from one place:
Common Patterns
Dashboard deep-link β build a shareable URL from an agent plus its session key.Best Practices
Prefer short-id + slug over the literal escape hatch
Prefer short-id + slug over the literal escape hatch
The
!<key> form exposes the whole key in the URL. Let build_session_path derive a short id whenever the key has a UUID tail so the raw key stays hidden.Keep short ids per-agent
Keep short ids per-agent
Short ids only need to be unique within one agentβs namespace β
agent_id scopes the lookup, and a resolver disambiguates the rare clash.Treat main / global / default / root as named sessions
Treat main / global / default / root as named sessions
Reserved sentinels are friendly named sessions, not short-id lookups. A resolver maps them to a well-known session such as the agentβs
main conversation.Never rebuild an agent_id by concatenation
Never rebuild an agent_id by concatenation
Always percent-escape via
build_session_path and let parse_session_path decode. An id containing / (e.g. team/assistant) round-trips correctly only when it goes through the grammar.This ships the pure grammar plus the
session.resolve method contract (scope: read). The concrete store-backed resolver, the praisonai gateway session resolve/url CLI, and dashboard URL building are wrapper follow-ups β not part of this change.Related
Session Portability
Back up, migrate, and restore gateway sessions
Session Sharing
Multi-observer read-only and co-driven sessions
Operator Scopes
Least-privilege RBAC β where
session.resolve sitsSession Protocol
The pluggable store contract behind sessions

