HKUDS/DeepTutor · error · RuntimeError
OpenAI Codex is not logged in. Run `deeptutor provider login
Error message
OpenAI Codex is not logged in. Run `deeptutor provider login openai-codex`.
What it means
_build_headers refuses to construct Authorization headers with an empty token, raising RuntimeError with the exact remediation command. The Codex session store yielded no access token.
Source
Thrown at deeptutor/services/llm/provider_core/openai_codex_provider.py:193
model,
reasoning_effort,
tool_choice,
on_content_delta,
)
def get_default_model(self) -> str:
return self.default_model
def _strip_model_prefix(model: str) -> str:
if model.startswith("openai-codex/") or model.startswith("openai_codex/"):
return model.split("/", 1)[1]
return model
def _build_headers(account_id: str, token: str) -> dict[str, str]:
if not token:
raise RuntimeError(
"OpenAI Codex is not logged in. Run `deeptutor provider login openai-codex`."
)
headers = {
"Authorization": f"Bearer {token}",
"OpenAI-Beta": "responses=experimental",
"originator": DEFAULT_ORIGINATOR,
"User-Agent": "DeepTutor (python)",
"accept": "text/event-stream",
"content-type": "application/json",
}
if account_id:
headers["chatgpt-account-id"] = str(account_id)
return headers
async def _request_codex(
url: str,
headers: dict[str, str],View on GitHub (pinned to 3e82f13042)
Solutions
- Run `deeptutor provider login openai-codex`.
- Verify the credential store was provisioned (volume-mounted in containers).
- Re-login after clearing a corrupted store.
Defensive patterns
Strategy: validation
Validate before calling
def codex_logged_in(token: str) -> bool:
return bool(token) Try / catch
try:
resp = await provider.chat(messages)
except RuntimeError as e:
if 'not logged in' in str(e):
run_cli('deeptutor provider login openai-codex')
raise Prevention
- Provision Codex credentials in CI via a mounted store before jobs
- Check credential existence in deployment checklists
- Automate re-login after credential store resets
When it happens
Trigger: _call_codex → _build_headers(account_id, token='') because the stored Codex auth session has no access token — user never logged in, or the credential store is empty/corrupt.
Common situations: Fresh machine or container without Codex credentials; credentials file deleted; running in CI without a pre-provisioned auth session.
Related errors
- GitHub Copilot auth is unavailable. Validate local Copilot a
- Invalid role: {role!r}. Must be 'admin' or 'user'.
- Embedding provider returned HTTP {response.status_code}
- OpenAI SDK request failed: {exc}
- GitHub Copilot token exchange returned no token.
AI-assisted analysis of HKUDS/DeepTutor@3e82f13042 (2026-08-27).
Data as JSON: /api/errors/5e8ca23adf504f2d.
Report an issue: GitHub.