tinyhumansai/openhuman · error
OPENAI_CODEX_OAUTH_MISSING_AUTH_URL
OPENAI_CODEX_OAUTH_MISSING_AUTH_URL
Error message
OPENAI_CODEX_OAUTH_MISSING_AUTH_URL
What it means
startOpenAiCodexOAuth called the core RPC openhuman.inference_openai_oauth_start successfully, but the result carried no non-empty result.authUrl (after trim). Without an authorization URL there is nothing to open in a browser, so the OAuth flow cannot start; the constant OPENAI_CODEX_OAUTH_MISSING_AUTH_URL marks this specific failure.
Source
Thrown at app/src/services/api/aiSettingsApi.ts:726
/** Clear a stored API key. */
export async function clearCloudProviderKey(slug: string): Promise<void> {
if (slug === 'openhuman') {
return;
}
// Clear the new-style key. Legacy bare-slug entries are left as-is
// since we can't be sure they aren't used by other things.
await authRemoveProviderCredentials({ provider: authKeyForSlug(slug), profile: 'default' });
}
export async function startOpenAiCodexOAuth(): Promise<OpenAiCodexOAuthStartResult> {
const res = await callCoreRpc<{ result: OpenAiCodexOAuthStartResult }>({
method: 'openhuman.inference_openai_oauth_start',
params: {},
});
const authUrl = res?.result?.authUrl?.trim();
if (!authUrl) {
throw new Error(OPENAI_CODEX_OAUTH_MISSING_AUTH_URL);
}
return res.result;
}
export async function completeOpenAiCodexOAuth(callbackUrl: string): Promise<void> {
const callback = callbackUrl.trim();
if (!callback) {
throw new Error(OPENAI_CODEX_OAUTH_MISSING_CALLBACK_URL);
}
await callCoreRpc({
method: 'openhuman.inference_openai_oauth_complete',
params: { callback_url: callback },
});
}
export async function importOpenAiCodexCliAuth(): Promise<void> {
await callCoreRpc({ method: 'openhuman.inference_openai_oauth_import_codex_cli', params: {} });
}View on GitHub (pinned to a221052e0d)
Solutions
- Update/restart the desktop core so inference_openai_oauth_start runs the current implementation
- Check the core-side OpenAI OAuth configuration (client id/secret env or config) and complete it
- Inspect the core logs for the oauth start handler to see why authUrl was omitted
- Wrap the call and surface a clear 'could not start OpenAI sign-in' message with a retry
Example fix
// before
const { authUrl } = await startOpenAiCodexOAuth();
window.open(authUrl, '_blank');
// after
let authUrl: string;
try {
({ authUrl } = await startOpenAiCodexOAuth());
} catch (e) {
showOAuthError('Could not start OpenAI sign-in. Update the app and try again.');
return;
}
window.open(authUrl, '_blank'); Defensive patterns
Strategy: try-catch
Type guard
const hasAuthUrl = (r: unknown): r is { authUrl: string } =>
typeof (r as { authUrl?: unknown })?.authUrl === 'string' && (r as { authUrl: string }).authUrl.trim().length > 0; Try / catch
try { const { authUrl } = await startOpenAiCodexOAuth(); openInBrowser(authUrl); }
catch (e) { showOAuthError('Could not start OpenAI sign-in — update/restart the app and retry.'); logError(e); } Prevention
- Treat OAuth start as fallible UI flow with explicit error state and retry
- Keep core and frontend versions in sync after OAuth-related updates
- Log the raw RPC result when authUrl is missing to speed up core-side diagnosis
When it happens
Trigger: Invoking 'Sign in with ChatGPT/Codex' and the core's OpenAI OAuth start handler returns { result: {} } or { result: { authUrl: ' ' } } — e.g. missing/misconfigured OAuth client credentials on the core side, or a core build where the OpenAI OAuth feature is degraded.
Common situations: Dev environment without the required OpenAI OAuth client id/secret configured in the core; version skew between an older core and a newer frontend expecting authUrl; enterprise proxy stripping the field. The RPC 'succeeds', so the failure only appears at this shape check.
Related errors
- OPENAI_CODEX_OAUTH_MISSING_CALLBACK_URL
- Model test RPC returned no result for ${workload} via ${prov
- OpenHuman uses the session JWT — keys are not configurable h
- Model testing is only available in the desktop app.
- ${context} returned an invalid response shape
AI-assisted analysis of tinyhumansai/openhuman@a221052e0d (2026-08-16).
Data as JSON: /api/errors/6b6f7d3cc602eae0.
Report an issue: GitHub.