Skip to content

[Bug]: Initial thread title generation hammers unavailable gpt-6-luna with up to 18 retries per new thread on HTTP 403 #44043

Done

Description

@lqy007700

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Leave textGenerationModelSelection at its default (codex / gpt-6-luna), while having another provider enabled and selected for chat (e.g., Antigravity gemini-4-hydrogen).
  2. Have the Codex /responses endpoint reject requests with 403 Forbidden (for example, via a local proxy quota-protection rule when 5h Codex usage reaches threshold, or any non-retryable 403 block on gpt-6-luna / Codex Official).
  3. Start a new thread and send any message using the non-Codex provider (Antigravity).

Expected behavior

  1. Non-retryable failures such as HTTP 403 Forbidden (or quota/auth rejections) in TextGeneration.generate / ThreadTitleRegenerationService.execute should not be retried repeatedly, and should either abort immediately or fall back to another healthy/enabled provider/model.
  2. Users should also have a way to disable automatic background thread title generation (textGenerationModelSelection: null or a dedicated toggle) when they do not want background model calls triggered on every new thread.

Actual behavior

Every new thread fires up to 18 failing gpt-6-luna requests in ~30 seconds due to two stacked retry layers, even though the active chat thread isn't using Codex at all:

  1. Codex CLI reconnect loop (6 HTTP requests per invocation): codex CLI (v0.172.0) receives 403 Forbidden and retries Reconnecting... 1/5 through 5/5 before exiting with failure.
  2. Server outer retry loop (3 invocations per initial title): ThreadTitleRegenerationService.execute (src/orchestration-v2/ThreadTitleRegenerationService.ts) wraps textGeneration.generateThreadTitle with:
    retry({
      times: input.kind.type === "initial" ? 2 : 0,
      schedule: exponential("2 seconds"),
    })
    Because TextGeneration.generate (src/textGeneration/TextGeneration.ts) only checks pre-flight provider state (selectedDisabled, exhaustedUsageWindow, etc.) and does not treat a 403 Forbidden failure as non-retryable or trigger runtime fallback to another enabled provider, it runs all 3 outer attempts × 6 CLI requests = 18 failing 403 requests per new thread.

Additionally, there is currently no setting in ServerSettings to turn off automatic initial thread title generation (pendingThreadTitleGenerationEffect), so users cannot opt out even if they don't want background title generation.

Impact

Major degradation or frequent failure

Version or commit

0.1.13 (bc0f04d)

Environment

macOS (darwin arm64), T3 Code (Beta) 0.1.13, OpenAI Codex CLI v0.172.0, active chat provider: Antigravity (gemini-4-hydrogen)

Logs or stack traces

{"type":"effect-span","name":"TextGeneration.generateThreadTitle","exit":{"_tag":"Failure","cause":"TextGenerationError: Text generation failed in generateThreadTitle: Codex CLI command failed: OpenAI Codex v0.172.0
--------
model: gpt-6-luna
provider: custom
approval: never
sandbox: read-only
reasoning effort: low
reasoning summaries: none
--------
...
ERROR: Reconnecting... 1/5
ERROR: Reconnecting... 2/5
ERROR: Reconnecting... 3/5
ERROR: Reconnecting... 4/5
ERROR: Reconnecting... 5/5
ERROR: unexpected status 403 Forbidden: ... model: gpt-6-luna ...
    at runCodexJson.runCodexCommand
    at runCodexJson
    at CodexTextGeneration.generateThreadTitle
    at ProviderInstallationGate.execute
    at TextGeneration.generate"}}

Observed sequence in server.trace.ndjson for a single new thread (UTC):

  • Attempt 1: 07:23:58.874Z -> 07:24:08.405Z (TextGeneration.generateThreadTitle Failure, 6 HTTP 403s)
  • Attempt 2: 07:24:10.410Z -> 07:24:18.744Z (TextGeneration.generateThreadTitle Failure, 6 HTTP 403s)
  • Attempt 3: 07:24:22.747Z -> 07:24:30.627Z (TextGeneration.generateThreadTitle Failure, 6 HTTP 403s)
  • Outer span: 07:23:58.864Z -> 07:24:30.637Z (ThreadTitleRegenerationService.execute)

Workaround

Change Settings → Providers → Thread titles and other generated text (textGenerationModelSelection) away from the default Codex gpt-6-luna to another enabled provider/model (e.g. Antigravity or a dedicated Text Generator API). There is currently no way to disable auto-title generation entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions