Skip to content

fix(voice): allow relay-connected microphone destinations to authorize requests - #31771

Closed
EtanHey wants to merge 1 commit into
pingdotgg:mainfrom
EtanHey:fix/relay-voice-authorization
Closed

EtanHey wants to merge 1 commit into
pingdotgg:mainfrom
EtanHey:fix/relay-voice-authorization

Conversation

@EtanHey

@EtanHey EtanHey commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Fixes #31767. Selecting a relay-connected environment for microphone audio fails immediately with “No relay authorization service is available for the environment request.” Speech requests run on the generic HTTP runtime, which lacks the connection session's remote authorizer.

Change

Run web/desktop speech effects through the existing connection atom runtime and application registry. This shares the session authorizer and token renewal across status probes, model management, streaming tickets, uploads, and transcript cleanup. Existing abort signals are forwarded to the effect runner.

Scope and approval

Small, focused fix for an obvious bug in the existing remote dictation capability; no new feature, setting, permission, contract, or visual behavior. The issue above records the desktop trace evidence. Mobile already uses connection-runtime speech atoms and is unchanged.

Verification

  • Failing first: the new browser regression, using the real speech HTTP effect and runtime, failed with the exact missing-service error. After the fix, a signed-out relay request reaches the connection authorizer and reports its expected authorization failure.
  • vp test run apps/web/src/speech/runtime.browser.test.ts apps/web/src/speech/useEnvironmentSpeechInput.browser.test.tsx: 21 passed.
  • vp run check:changed: format, lint, affected-package typecheck, both knip checks, focused tests, and React compiler checks passed; typecheck emitted existing schema-brand suggestions.
  • Local CodeRabbit review exceeded its 45-second budget and was stopped.
  • Signed-in relay audio capture/upload and the installed desktop app have not been verified. No installed-app changes or live database writes.

Implementer: Codex. Inner review: Codex approved at d859363, 1 completed round, no blocking findings (user explicitly selected Codex after Claude hit its API rate limit). All latest-head CI checks passed or skipped. Signed-in live audio remains unverified. Regression guard: relay speech request browser test.

🤖 gpt-6.1-sol via T3 Code / Codex harness

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 6, 2026
@EtanHey
EtanHey marked this pull request as ready for review November 6, 2026 02:25
@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Speech requests now use a local runtime wrapper that runs HTTP effects through the connection atom runtime. The browser voice input and environment speech hook use this wrapper. A browser test checks the authorization error for an expired DPoP credential when no account is signed in.

Changes: Speech runtime authorization

Layer / File(s) Summary
Connection-aware runtime and authorization test
apps/web/src/speech/runtime.ts, apps/web/src/speech/runtime.browser.test.ts
Adds speechRuntime.runPromise, which runs HTTP effects through the connection atom runtime and forwards optional abort-signal options. A browser test checks that an environment speech status request rejects with the expected authorization error for expired DPoP credentials when no account is signed in.
Speech caller integration
apps/web/src/speech/browserVoiceInput.ts, apps/web/src/speech/useEnvironmentSpeechInput.ts, apps/web/src/speech/useEnvironmentSpeechInput.browser.test.tsx
Updates both speech callers to import the local speechRuntime wrapper. Updates the hook test mock to use the local runtime module.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

  • pingdotgg/t3code#30623: Adds the environment dictation hook and browser transcription path that this change updates to use the connection runtime.
  • pingdotgg/t3code#31769: Adds cloud transcription and uses authenticated environment requests for speech effects.
  • pingdotgg/t3code#30624: Uses useEnvironmentSpeechInput for desktop annotation dictation, a hook updated by this change.

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · up to d8593

The change is mergeable after normal checks. Signed-in relay capture and installed desktop behavior remain unverified, but no specific failure was established.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title clearly describes the relay authorization fix for microphone destinations.
Description check Passed The description covers the problem, change, scope, and verification. It identifies signed-in audio and the installed desktop app as unverified.
Linked Issues check Passed [#31767] Speech requests now use the connection atom runtime and application registry. This provides the session authorizer instead of the generic HTTP runtime. The browser regression confirms that an…
Out of Scope Changes check Passed [#31767] The runtime wrapper, speech call-site changes, and browser tests support the relay authorization fix. The diff shows no unrelated changes.
Full details: Linked Issues check

Explanation

[#31767] Speech requests now use the connection atom runtime and application registry. This provides the session authorizer instead of the generic HTTP runtime. The browser regression confirms that an expired relay request reaches the authorizer rather than failing for a missing service. Signed-in live audio remains unverified.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c52df24 and d859363.

Files selected for processing: 5

  • apps/web/src/speech/browserVoiceInput.ts
  • apps/web/src/speech/runtime.browser.test.ts
  • apps/web/src/speech/runtime.ts
  • apps/web/src/speech/useEnvironmentSpeechInput.browser.test.tsx
  • apps/web/src/speech/useEnvironmentSpeechInput.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Copy link
Copy Markdown
Member

Thanks @EtanHey for tracking this down: running speech requests through the connection runtime is the right fix, and your regression test shows it clearly. We're closing this in favour of https://git.cafe/pingdotgg/t3code/pulls/31778, which fixes the same issue (https://git.cafe/pingdotgg/t3code/issues/31767) the same way and also moves the Voice settings panel's own requests (status, model list, download/select/remove) off the generic runtime. On main those still call lib/runtime directly, so choosing a relay destination in Settings would keep failing without that part. Your PR helped confirm the cause.

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

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Selecting a relay-connected microphone destination fails with missing authorization service

2 participants