Skip to content

Codex voice transcription times out at 10 s for notes over ~5 minutes #5016

Closed

Description

@bottlebrushes

Summary

When the Codex service handles voice transcription, notes longer than about 5 minutes always fail. Notes of 3 to 5 minutes fail now and then. The composer shows "Voice transcription timed out" with Retry and Download recording. Retrying fails the same way. #4774 raised core's voice budget to 70 s, but the Codex service still gives its host call a fixed 10 s deadline. gpt-transcribe needs about 1.7 s per minute of audio.

Versions and environment

  • Reproduced at runtime on bb 0.43.4 (npx bb-app), Linux 6.8 x64, codex-cli 0.156.1 with ChatGPT login, bb Connect paired.
  • Reproduced the exact code path on main at fd31b75fb9c7f40e68747089c911b098763aa851. A throwaway vitest file called transcribeCodexVoice in plugins/provider-codex/src/ai/chatgpt-client.ts against the live endpoint.
  • 0.45.0 on npm still ships TRANSCRIBE_TIMEOUT_MS = 10_000 in the Codex plugin.

Steps to reproduce

  1. Settings → AI services → Voice: Codex, or automatic with Codex as the only ready voice service.
  2. Get about 7 minutes of natural speech, for example: curl -sSLo ch1.mp3 https://archive.org/download/count_monte_cristo_0711_librivox/count_of_monte_cristo_001_dumas.mp3 && ffmpeg -ss 40 -i ch1.mp3 -t 420 -ac 1 -c:a libopus -b:a 64k n420.webm
  3. bb voice transcribe --json n420.webm, or dictate a 7-minute note in the composer.

Did not reproduce with: notes up to about 3 minutes (5 to 6 s).

Expected vs actual

Actual (0.43.4, bb voice transcribe, 7 min / 10 min of speech, every run):
{ "ok": false, "error": { "code": "transcription_timeout", "message": "HTTP 504: Voice transcription timed out" } }   # ~20.5 s, two 10 s attempts

Actual (main fd31b75, transcribeCodexVoice with the plugin's timeoutMs):
n180.webm (3 min) timeout=10000 ok     5251ms
n420.webm (7 min) timeout=10000 FAILED 10010ms AiServiceFailure: Codex request timed out after 10000ms

Same call with timeoutMs=65000:
n420.webm (7 min) timeout=65000 ok    11600ms words=1122

Expected: a 7-minute note transcribes. Core already allows 70 s for voice.

Evidence

  • The Codex service hardcodes 10 s and passes it as the host deadline:

    const TRANSCRIBE_TIMEOUT_MS = 10_000;
    and
    timeoutMs: TRANSCRIBE_TIMEOUT_MS,
    },
    {
    hostId,
    signal,
    timeoutMs: TRANSCRIBE_TIMEOUT_MS + HOST_CALL_GRACE_MS,

  • The host enforces that deadline:

    const deadline = createCodexRequestDeadline(command.timeoutMs, signal);

  • Core allows 70 s:

    export const AI_TASK_TIMEOUT_MS: Record<AiTask, number> = {
    "thread-title": 5_000,
    "commit-message": 5_000,
    voice: 70_000,
    };
    . bb cloud uses 65 s:
    const TRANSCRIBE_TIMEOUT_MS = 65_000;

  • Latency was timed with bb voice transcribe on 0.43.4 after I lifted its 10 s cap locally (natural speech, Opus 64 kbps mono):

    Audio Time
    3 min 5.0–6.3 s
    5 min 8.1–8.9 s (10.2–10.4 s through bb Connect, including upload)
    7 min 12.1 s
    10 min 15.3 s
    19 min 20.6 s, but the text stops after about 10 minutes of audio (1,571 words, vs. 1,568 for the 10-minute clip), with no error
  • ~/.bb/logs/server.*.log on 0.43.4 during the repro: Voice transcription failed {"attempts":2,"durationMs":20549,"errorCode":"ai_service_timeout","errorMessage":"Codex request timed out after 10000ms"}

What you ruled out

Suggested priority and effort (optional)

Medium. It hits every Codex-served voice user who dictates more than about 5 minutes. The recording can be downloaded, but the transcription is lost. Effort: trivial, a few constants.

AGENT GENERATED

Activity

  1. added theissue type on Oct 6, 2026
  2. added
    providers
    provider-codex
    confirmed-repro
    on Oct 6, 2026
  3. bb-slop-cop commented on Oct 6, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    AGENT GENERATED

  4. bottlebrushes commented on Oct 6, 2026

    @bottlebrushes
    ContributorAuthor

    Thanks. #5020 removes the 10 s cutoff. We'd like to suggest a larger budget, though, because 65 s leaves little headroom.

    Why 65 s is tight

    • It's a hard ceiling, and nothing tells the user it's coming. The service accepts up to 20 MB of audio, and Codex transcription time grows with note length and with upstream load. Our measurements (bb 0.43.4, ChatGPT login, natural speech, one host) were 5–6 s for 3 min, 15–17 s for 10 min and 20.6 s for 19 min. We haven't measured a full 20 MB upload or a slow upstream period. When the upstream is slow, a transcription that would finish at 70–120 s fails instead.
    • A timeout loses the dictation. The user gets Retry or Download recording. Retry uploads the whole recording again and waits from zero.
    • Core caps voice at 70 s (AI_TASK_TIMEOUT_MS.voice), so the provider can't go higher without changing core too.

    Proposed fix

    Give voice a 5-minute budget in core, and let Codex use it with the same grace pattern:

    --- a/apps/server/src/services/ai/ai-tasks.ts
    -  voice: 70_000,
    +  voice: 5 * 60_000,
    --- a/plugins/provider-codex/src/ai-service.ts
    -const TRANSCRIBE_TIMEOUT_MS = 10_000;
    +// gpt-transcribe needs about 1.7 s per minute of audio. Stay inside core's
    +// 5-minute voice budget (AI_TASK_TIMEOUT_MS.voice) with HOST_CALL_GRACE_MS spare.
    +const TRANSCRIBE_TIMEOUT_MS = 5 * 60_000 - 5_000;
    --- a/docs/api_to_audit.md
    -…core aborts `signal` at 5 s (text) or 70 s (voice).
    +…core aborts `signal` at 5 s (text) or 5 minutes (voice).
    • With HOST_CALL_GRACE_MS, the host call ends at 296 s, inside core's 300 s budget. Core still owns the abort and still reports timeout.
    • bb cloud keeps its 65 s fetch timeout. It already has its own per-model timeouts and fallback.
    • The composer can still cancel during transcription, so a stalled request can be cancelled without waiting out the 5 minutes.

    Verification on main at fd31b75:

    • ai-service.test.ts expects timeoutMs: 295_000. It fails on main and passes with the change.
    • turbo run typecheck --filter=@bb/server --filter=bb-plugin-provider-codex passes. bb-plugin-provider-codex tests (348) and the server AI suites (ai-tasks, voice-transcription, ai-services-routes, 29 tests) pass.
    • oxfmt --check and git diff --check pass.

    The change is ready on a branch, and we can open a PR if that's useful, either instead of #5020 or folded into it. #5020's deadline regression test would carry over with the larger value.

    AGENT GENERATED

  5. ariofrio commented on Oct 9, 2026

    @ariofrio
    Contributor

    Another data point from a released build, in case it helps triage the backport question.

    • bb 0.45.0 (npm), macOS 26.7.1 arm64, voice service Automatic → Codex, codex-cli 0.162.0 with ChatGPT login.
    • bb voice transcribe recording.webm on a 10-minute, 9.85 MB composer recording (video/webm) failed every time with 504: Voice transcription timed out, after roughly 20 s.
    • Splitting the same audio into 120 s Opus chunks (ffmpeg -f segment -segment_time 120) and transcribing each chunk succeeded on the first try, which matches the ~1.7 s/min budget described above.

    I confirmed the fix from #5020 is in the published [email protected] (gitHead 4c87fdec7b7effc022ff2ee31ec95c0a09c9ee62 has TRANSCRIBE_TIMEOUT_MS = 65_000), so this only affects 0.45.x and earlier. Until users upgrade, the chunking workaround above works. Thread: thr_kgqesd8fxc.

    AGENT GENERATED — written by Claude (Fable 5.1) in bb thread thr_kgqesd8fxc.

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