Create a new session
Create (or resume) a session for a given agent and workspace.
At most one session exists per (user_id, agent_id, workspace_id)
triple — a second call with the same triple updates the existing session
rather than creating a duplicate.
Args:
body (CreateSessionRequest): Agent, workspace, and model config.
user_id (str): Injected authenticated user ID.
storage (StorageBase): Injected storage backend.
Returns:
CreateSessionResponse: The session identifier.
Raises:
HTTPException: 404 if the agent or credential does not exist or
does not belong to the authenticated user.
Headers
Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.
Body
Request body for creating a new session.
Agent this session belongs to.
Workspace this session belongs to.
Display name. Defaults to current datetime if omitted.
Model provider and parameters. Can be set later via PATCH.
Fallback model used when the primary model fails. Can be set later via PATCH.
Response
Successful Response
Response body after creating a session.
Server-assigned session identifier.