odysseus-dev/odysseus · error · HTTPException
Your account is not allowed to use model '{sess.model}'.
Error message
Your account is not allowed to use model '{sess.model}'. What it means
Raised by the chat privilege gate when the authenticated user's privileges contain the 'block_all_models' sentinel. This sentinel is the explicit 'block everything' setting an admin sets when a user selected [None] in the model allowlist UI; it takes precedence over any allowlist interpretation so an empty list is not mistaken for 'no restriction'.
Source
Thrown at routes/chat_helpers.py:214
"""
try:
user = effective_user(request)
except Exception:
user = None
if not user:
return
auth_manager = getattr(getattr(request.app, "state", None), "auth_manager", None)
if not auth_manager:
return
privs = auth_manager.get_privileges(user) or {}
# Explicit "block everything" sentinel takes precedence over the
# allowlist — it's the only way to distinguish "user clicked [None]"
# (block all) from "user clicked [All]" (no restriction), since both
# otherwise produce an empty `allowed_models` list.
if privs.get("block_all_models"):
raise HTTPException(403, f"Your account is not allowed to use model '{sess.model}'.")
allowed_models = _allowed_models_from_privileges(privs)
if allowed_models is not None and sess.model and sess.model not in allowed_models:
raise HTTPException(403, f"Your account is not allowed to use model '{sess.model}'.")
cap = int(privs.get("max_messages_per_day") or 0)
if cap <= 0:
return
from datetime import datetime as _dt, timedelta as _td
from core.database import Session as _DbSess, ChatMessage as _Cm
db = SessionLocal()
try:
count = (
db.query(_Cm)
.join(_DbSess, _Cm.session_id == _DbSess.id)
.filter(_DbSess.owner == user,
_Cm.role == "user",View on GitHub (pinned to f9235ebbf1)
Solutions
- Ask an admin to clear the block-all setting or grant at least one allowed model for this user
- If you are the admin, edit the user's privileges and set an explicit allowed_models list instead of [None]
- Check the auth_manager privilege store for a stale block_all_models flag left by a prior configuration
Defensive patterns
Strategy: validation
Validate before calling
const me = await fetch('/api/me/privileges').then(r=>r.json());
if (me.block_all_models) { disableChatCompose('Model access blocked for this account'); } Try / catch
try { await sendChat(...); } catch (e) { if (e.status === 403 && /not allowed to use model/.test(e.message)) { showModelLockedUI(); } else { throw e; } } Prevention
- Surface model-blocked state in the UI before the user types
- Admins: prefer explicit allowlists over the [None]/block-all sentinel for partial access
When it happens
Trigger: Any chat send (streaming or non-streaming) where the user's privilege blob has block_all_models truthy. sess.model is echoed in the message but the block applies regardless of which model the session holds.
Common situations: Admin set the user's model access to [None] in the admin panel; a privilege record was written with the sentinel by a management script; the user still has an old chat session open and keeps hitting send.
Related errors
- Admin only
- Session '{session}' not found
- Authentication required
- Message not found
- Action '{action}' requires admin privileges
AI-assisted analysis of odysseus-dev/odysseus@f9235ebbf1 (2026-08-14).
Data as JSON: /api/errors/c93429966b0e2f57.
Report an issue: GitHub.