Skip to content

Transcription often fails with HTTP 403 due to cloudflare when using codex subscription #1587

Closed

Description

@markasoftware-tc

When codex subscription mode is enabled, transcribing anything (bb voice transcribe ./whatever.mp3) seems to usually fail on my machine. I haven't tested with an API key but I suspect that would fix it, since rn it hits a chatgpt.com endpoint meant for internal use vs an actual official api endpoint.

Activity

  1. added theissue type on Aug 14, 2026
  2. jandornig commented on Aug 15, 2026

    @jandornig

    same here

  3. added
    providers
    provider-codex
    on Aug 18, 2026
  4. SawyerHood commented on Aug 18, 2026

    @SawyerHood
    Collaborator

    Reproduction & root-cause report: https://get-bb.github.io/reports/issues/1587.html

    • Verdict: REPRODUCED · root-cause confidence: high
    • Root cause (short): Subscription-mode voice transcription posts to the ChatGPT web app's Cloudflare-bot-protected endpoint https://chatgpt.com/backend-api/transcribe (not a Codex endpoint); when Cloudflare returns a managed challenge (403 + cf-mitigated: challenge) the daemon retries once with cookies, then throws non-transient codex_request_failed carrying the challenge HTML, so the server neither retries nor falls back and the user sees "HTTP 502: Codex transcription request failed with HTTP 403: ...".
    • Proposed fix: Daemon: in transcribeCodexVoice/createCodexHttpError, when the response is still a Cloudflare challenge after the cookie retry, throw codex_service_unavailable (or a new codex_cloudflare_challenge code added to the server's isTransientInferenceError, with a HOST_DAEMON_PROTOCOL_VERSION bump) with a clean message, and never append text/html bodies to error messages. Server: make the transcription fallback meaningful — if OPENAI_API_KEY is configured, fall back to the openai/ path (api.openai.com) after a transient/challenge failure instead of fallbackModel === primary model; otherwise ke…
    • Caveats: Revision: fixed the verifier's major finding by rewriting run-cli-transcribe.sh and cf-challenge-preload.mjs to be environment-driven (WORKTREE, BB_SERVER_URL, CF_PRELOAD_DIR default /tmp/bb-1587-preload; preload finds cf-challenge-body.html relative to itself; wrapper no longer deletes the log artifact) and re-ran step D from scratch in this worktree (wf_6b6686dc-4c2-26, HEAD a108fa7, server :2…

    The report has copy-paste repro steps, screenshots where the bug is visual, code permalinks at 16ceb3a54, and repro artifacts. It was independently re-run by a second agent (see its Verification section).

    AGENT GENERATED: by Claude Opus 5

  5. added
    confirmed-repro
    on Aug 18, 2026
  6. fangerya commented on Oct 27, 2026

    @fangerya

    Summary

    Codex subscription voice transcription consistently fails on my installation with a Cloudflare challenge in BB 0.47.1, despite the error-handling changes in #2159.

    Curl successfully transcribes the same recording using identical credentials, explicit headers and multipart body bytes. Node.js fetch receives a Cloudflare challenge immediately before and afterward.

    Versions and environment

    • BB 0.47.1, npm installation. BB’s update check reported no newer release when tested.
    • Published package gitHead: 5e1acd765039e874643f34c4d35409e58484e408. Tests used the installed release, not a source checkout.
    • Primary transcription machine: Ubuntu 26.04.1 LTS, x64.
    • Host diagnostic runtime: Node 26.10.0, curl 8.18.0, Codex CLI 0.164.0.
    • Authentication: ChatGPT subscription.
    • Voice selection: Automatic, with Codex as the only enabled voice service.
    • BB’s UI and CLI are accessed from a Mac; transcription runs on the Linux primary machine.
    • Tested on 27 October 2026.

    Steps to reproduce

    On the affected installation:

    1. Select Codex under Settings → AI services → Voice input, or Automatic with Codex as the only available voice service.

    2. On the Mac, generate a short synthetic speech recording:

      say -o /tmp/bb-dictation-probe.wav \
        --data-format=LEI16@16000 \
        'This is a short voice transcription test.'
    3. Submit it through BB:

      bb voice transcribe /tmp/bb-dictation-probe.wav \
        --type audio/wav --json

    The recording is approximately 2.7 seconds. This reproduces the composer’s failure without microphone capture. Reproduction on other installations has not been verified.

    Expected vs actual

    Expected: the transcript “This is a short voice transcription test.”

    Actual CLI output:

    Error: HTTP 502: Codex: Codex transcription request failed with HTTP 403: chatgpt.com answered with a Cloudflare challenge that bb cannot solve. Retry, or choose another service in Settings → AI services.
    

    Direct diagnostic requests confirm HTTP 403, content-type: text/html; charset=UTF-8, and cf-mitigated: challenge.

    Evidence

    Authenticated diagnostic requests were made on the Linux primary machine to:

    https://chatgpt.com/backend-api/transcribe
    

    The comparison used the same credentials, endpoint, explicit headers and identical serialized multipart body bytes. Headers retained BB’s originator: bb and User-Agent: bb-host-daemon.

    Test Result
    Node fetch 403, cf-mitigated: challenge
    Curl, HTTP/2 200, correct transcript
    Curl forced to HTTP/1.1 200, correct transcript
    Curl with -q --noproxy '*' 200, correct transcript
    Node fetch repeated afterward Same 403 challenge

    Successful responses contained:

    {"text":"This is a short voice transcription test."}

    The diagnostic environment had no standard proxy variables set. The final curl test additionally disabled automatic curl configuration and explicitly bypassed proxies.

    The exact characteristic triggering Cloudflare remains unknown; the curl workaround has not been integrated into BB. No BB settings, authentication or installed code were changed.

    Investigation: @thread:thr_rnt8yhhuwh

    What you ruled out

    AGENT GENERATED

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

    confirmed-reproprovider-codexproviders

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions