HKUDS/DeepTutor · error · LLMProviderTransportError

Codex transport request failed.

Error message

Codex transport request failed.

What it means

A low-level transport exception (connection error, timeout, TLS failure) occurred while calling Codex. If it matches is_transient_transport_error, it's re-raised as LLMProviderTransportError with a deliberately generic message so no URL, proxy, or token-bearing request leaks; the exception type is logged for operators.

Source

Thrown at deeptutor/services/llm/provider_core/openai_codex_provider.py:135

                    tool_calls=tool_calls,
                    finish_reason=finish_reason,
                )
            except CodexHTTPError as exc:
                return LLMResponse(
                    content=f"Error calling Codex: {exc}",
                    finish_reason="error",
                )
            except CodexAuthError as exc:
                return LLMResponse(
                    content=f"Error calling Codex: {exc.public_message}",
                    finish_reason="error",
                )
            except Exception as exc:
                if is_transient_transport_error(exc):
                    # Preserve a structured retry signal without exposing the
                    # URL, proxy, response body, or token-bearing request.
                    logger.warning("Codex transport request failed: {}", type(exc).__name__)
                    raise LLMProviderTransportError("Codex transport request failed.") from exc
                # The user-facing text stays generic so upstream payloads never
                # leak, but an operator still needs the real cause in the log.
                logger.exception("Codex request failed")
                return LLMResponse(
                    content="Error calling Codex: Codex request failed. Please try again.",
                    finish_reason="error",
                )

    async def chat(
        self,
        messages: list[dict[str, Any]],
        tools: list[dict[str, Any]] | None = None,
        model: str | None = None,
        max_tokens: int = 4096,
        temperature: float = 0.7,
        reasoning_effort: str | None = None,
        tool_choice: str | dict[str, Any] | None = None,
        **kwargs: Any,

View on GitHub (pinned to 3e82f13042)

Solutions

  1. Retry the request — the error class marks it as transient/retryable.
  2. Check network/proxy connectivity to the Codex endpoint.
  3. If persistent, inspect logs (the exception type name is logged via logger.warning).
Defensive patterns

Strategy: retry

Try / catch

try:
    resp = await provider.chat(messages)
except LLMProviderTransportError:
    await asyncio.sleep(min(2 ** attempt, 30)); retry(max_attempts=5)

Prevention

When it happens

Trigger: _call_codex's HTTP request raises a transient transport error (DNS failure, connection reset, timeout, proxy hiccup) — chat and chat_stream both surface this.

Common situations: Flaky network, corporate proxy dropping long-lived streaming connections, TLS interception failures, transient DNS issues.

Related errors


AI-assisted analysis of HKUDS/DeepTutor@3e82f13042 (2026-08-27). Data as JSON: /api/errors/ae9a3ab756d48791. Report an issue: GitHub.