HKUDS/nanobot · error · OpenAICodexOAuthInputError
Paste the full callback URL from your browser.
Error message
Paste the full callback URL from your browser.
What it means
Raised by _validate_callback_url when complete()/complete_openai_codex_oauth_login is given an empty or whitespace-only callback_url. It is an input-validation error: no URL was supplied to extract the authorization code from.
Solutions
- Paste the entire callback URL from the browser's address bar after signing in
- Do not submit an empty value unless intentionally cancelling
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at nanobot/providers/openai_codex_oauth.py:214 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of HKUDS/nanobot@42f37dc4c0 (2026-08-26).
Data as JSON: /api/errors/3b4d47c699d6d1ea.
Report an issue: GitHub.
Appendix: source
Thrown at nanobot/providers/openai_codex_oauth.py:214
return OpenAICodexOAuthLoginFlow(
proxy=proxy,
timeout_s=timeout_s,
open_browser=open_browser,
).start()
def complete_openai_codex_oauth_login(
flow: OpenAICodexOAuthLoginFlow,
callback_url: str | None = None,
) -> OAuthToken | None:
"""Complete a pending Codex login from a full callback URL."""
return flow.complete(callback_url)
def _validate_callback_url(raw: str) -> tuple[str, bool]:
value = raw.strip()
if not value:
raise OpenAICodexOAuthInputError("Paste the full callback URL from your browser.")
try:
parsed = urlsplit(value)
port = parsed.port
except ValueError as exc:
raise OpenAICodexOAuthInputError(
"The callback URL is invalid. Copy the full URL from your browser's address bar."
) from exc
if (
parsed.scheme != _CALLBACK.scheme
or parsed.hostname not in _CALLBACK_HOSTS
or port != _CALLBACK.port
or parsed.path != _CALLBACK.path
or parsed.username is not None
or parsed.password is not None
):
raise OpenAICodexOAuthInputError(
f"Paste the full callback URL from your browser ({OPENAI_CODEX_PROVIDER.redirect_uri}?...)."
)View on GitHub (pinned to 42f37dc4c0)