Skip to content

Allow Codex voice requests to use the transcription budget - #5020

Merged
SawyerHood merged 2 commits into
mainfrom
slopcop/issue-5016
Oct 6, 2026
Merged

SawyerHood merged 2 commits into
mainfrom
slopcop/issue-5016

Conversation

@bb-slop-cop

@bb-slop-cop bb-slop-cop Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🚨 SLOP COP 🚨 · new-issue-autopilot

Human comments

What was wrong

Two deadlines below core's 70-second voice budget cut off long transcriptions:

  1. Codex service. It supplied a 10-second transcription deadline (11-second host RPC deadline), so a Codex response arriving later failed with Codex request timed out after 10000ms.
  2. bb Connect. Both Connect HTTP paths (the worker-held relay used in production, apps/connect/src/relay.ts, and the TunnelDO proxy, apps/connect/src/tunnel-do.ts) give every request a fixed 30-second response-header deadline, armed before the request body uploads. Core sends the voice route's response headers only after transcription finishes, so any remote transcription taking more than about 30 s, including upload, returned 504 bb connect: timed out waiting for the tunnel client. That happened even with core and the provider allowing longer. Raising the Codex budget alone would still leave remote users capped at 30 s.

Reproduction and root-cause report for the Codex deadline: https://get-bb.github.io/reports/issues/5016.html

What changed

Layer Before After
Codex transcription request (TRANSCRIBE_TIMEOUT_MS) 10 s 65 s (matches bb cloud's 65 s)
Codex host RPC (+ HOST_CALL_GRACE_MS) 11 s 66 s
Core voice task (AI_TASK_TIMEOUT_MS.voice, per service) 70 s 70 s (unchanged)
SDK / CLI default request timeout 75 s 75 s (unchanged)
Connect response head for POST /api/v1/system/voice-transcription 30 s 90 s
Connect response head for every other request, port shares, and non-POST requests to the voice path 30 s 30 s (unchanged)

The 90-second Connect budget is core's 70 s plus 20 s for uploading the recording. The timer still starts before upload (#4832), and core accepts up to 25 MB. Each deadline sits above the one it wraps: 65 < 66 < 70 < 90. The new apps/connect/src/response-head-timeout.ts is shared by both Connect paths, so they can't drift apart.

No change to the server/daemon or tunnel wire protocol, schemas, stored data, credentials, or headers. Only the gateway's own timer changes.

How you verified

  • Unit regressions, failing before and passing after. In relay.test.ts (worker relay) and worker.test.ts (TunnelDO proxy): a voice response head at 85 s now relays a 200 transcript, and no head by 90 s still returns 504 and closes the relay. On the previous head, all 4 failed because the gateway settled with a 504 at 30 s. Controls: a GET of the voice path, a port share at the voice path, and another upload keep the 30 s deadline. The Codex regression (endpoint answering at 64 s through the real service and host client) failed with Codex request timed out after 10000ms before the fix.

  • End to end through a local Connect gateway. wrangler dev --local ran the real Connect worker and TunnelDO with a throwaway local D1 and synthetic credentials. The real @bb/tunnel-client TunnelSession dialed it, an origin stood in for the voice route, and visitors authenticated with a machine credential. All 5 cases ran concurrently:

    Case Previous head (relay) This head (relay) This head (TunnelDO path)
    Voice, 0.5 s (normal latency) 200 at 1.5 s 200 at 1.5 s 200 at 1.5 s
    Voice, 60 s (2.5 MB upload) 504 at 31 s 200 at 61 s 200 at 61 s
    Voice, never answers (true timeout) 504 at 31 s 504 at 91 s; origin request cancelled 504 at 91 s
    Other route, 45 s (control) 504 at 31 s 504 at 31 s 504 at 31 s
    Origin received gateway/visitor credentials or cookies none none none
  • pnpm exec turbo run test typecheck lint --filter=@bb/connect --filter=bb-plugin-provider-codex passes: Connect 8 files and 200+ tests, provider-codex 33 files.

Limits. This does not fix #5016's separate report that a 19-minute recording comes back truncated after about 10 minutes of text with no error. That is transcription completeness, not a deadline. Nothing ran against a live provider or the production gateway. In local workerd, a visitor that disconnects before the response head does not cancel the origin request in either version; before, the gateway's 30 s timer ended it, and now core's own 70 s per-service budget bounds it. In automatic mode with several ready voice services, core's budget applies to each service in turn, so a fallback chain can still exceed 90 s through Connect.

Fixes #5016

AGENT GENERATED

Both Connect HTTP paths (worker-held relay and TunnelDO proxy) gave every
request a fixed 30-second response-head deadline, armed before upload.
Core answers the voice route only after transcription finishes, so any
remote transcription over ~30 s returned a gateway 504 even though core
allows 70 s. Use 90 s for core's POST /api/v1/system/voice-transcription
(70 s core budget plus upload headroom); all other requests keep 30 s.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@SawyerHood
SawyerHood merged commit 0adb544 into main Oct 6, 2026
41 checks passed
@SawyerHood
SawyerHood deleted the slopcop/issue-5016 branch October 6, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant