Repository navigation
fix(stt): tell the user when AWS denies Transcribe access - #15968
Conversation
UX Review (Opus 5.5, fork) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS No first-time reader has seen the new three-sentence access-denied notice. The screenshots show it in full at both widths. Watch
Suggestions
[UX-REVIEWED] f1ec0c3 Description read[DESCRIPTION-READ] 5d75bb5c963101b7822432ee6d8705b043d7f9b1ee639d9bf0003c31ae8f8cf1 That sha256 names everything this verdict read: the PR description, plus the 6 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] f1ec0c3 Description read[DESCRIPTION-READ] f19802963869fff696527920e811762294f966140791bee4969071f2c560aac6 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Check before merge: no real AWS refusal was reproduced. The classifier rests on the SDK parser test and the exception logged in #15932. What this change shipsInventory (6 items) — 4 justifiedIntent: when AWS refuses the Transcribe stream for lack of permission, a dictating user is told the real cause and the fix instead of being told to retry. FIX (#15932).
[FIRST-PRINCIPLES-REVIEWED] f1ec0c3 Description read[DESCRIPTION-READ] 6f77edc76e3e6c8587fe3bd0ce210dcc24c3542ab536f81bf7c306c13ed79351 That sha256 names the PR description this verdict read. Recompute it with |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
2468d13 to
96a08c6
Compare
Sent by an AI agent on behalf of Amad |
Sent by an AI agent on behalf of Amad |
Sent by an AI agent on behalf of Amad |
Sent by an AI agent on behalf of Amad |
Sent by an AI agent on behalf of Amad |
96a08c6 to
86103a9
Compare
Sent by an AI agent on behalf of Amad |
Sent by an AI agent on behalf of Amad |
Sent by an AI agent on behalf of Amad |
86103a9 to
5e30960
Compare
Sent by an AI agent on behalf of Amad |
Sent by an AI agent on behalf of Amad |
5e30960 to
ba569a7
Compare
|
Update: every check on the current head ( For the record: on the four heads before this one the GPT lane failed closed when its reviewer tried a web search the lane's identity is not allowed to use. That lane setting is tracked in #16142, and #16161 turns web search off in both GPT review lanes so the failure cannot recur. Sent by an AI agent on behalf of Amad |
ba569a7 to
67ca784
Compare
Sent by an AI agent on behalf of Amad |
Sent by an AI agent on behalf of Amad |
|
Thanks for the heads up I will be revising and sending a revision |
When AWS refuses to start a dictation stream with AccessDeniedException, the socket reported the generic stt_session_failed and the composer said "Try recording again", which can never succeed. The consent gate cannot catch this case: its sts:GetCallerIdentity probe needs no permission. Report that refusal as stt_aws_access_denied and render it, in all 12 catalogs, as a notice that names the fix: refresh the profile's credentials, and if that fails, allow the profile to call StartStreamTranscription. Every other start failure keeps stt_session_failed. Fixes kirodotdev#15932
67ca784 to
f1ec0c3
Compare
Sent by an AI agent on behalf of Amad |
Sent by an AI agent on behalf of Amad |
iamwhatever
left a comment
There was a problem hiding this comment.
Approving (crew-pr-reviewer). Only Transcribe's AccessDeniedException gets its own stt_aws_access_denied code and a fixed message. AWS's own text is not echoed, because it carries the caller's ARN. Every other start failure keeps the old code. No credential handling changes. CI is green and the base is main.
Problem / Motivation
Goal: When AWS refuses to start a dictation stream because the configured credentials lack permission, the composer says so and names the fix, instead of telling the user to record again.
With an AWS profile whose credentials can call
sts:GetCallerIdentitybut nottranscribe:StartStreamTranscription, dictation shows "The dictation session failed. Try recording again." Every retry fails the same way. The real cause, an HTTP 403AccessDeniedException, is only in the gateway log.Why it matters
Anyone whose AWS identity, or whose temporary credentials' session policy, lacks the Transcribe streaming permission is stuck. The UI advises a retry that can never work, and only someone who can read the gateway log finds the cause. Scoped temporary credentials make this easy to hit: refreshing them with a narrower scope silently removes the permission.
Not a goal
POST /api/stt/transcribe). It reports every failure asstt_failedbecausetranscribe_audioreturns onlyNone; giving it a reason changes that function's contract for every caller.What changed (motivation → approach → change)
errorcode when AWS denies the stream startstt_session_failedstt_aws_access_deniedThe Transcribe branch of
api_ws_sttindashboard/stt_stream.pyreported every exception fromstart_stream_transcriptionasstt_session_failed. AWS authorizes the stream only when it opens, and the consent gate'ssts:GetCallerIdentityprobe needs no permission, so credentials that may not stream pass every earlier check and fail identically on each retry.A new helper,
_transcribe_start_failure, picks the frame's message and code. The SDK'sUnknownServiceExceptionwith error typeAccessDeniedExceptiongetsstt_aws_access_denied; everything else keepsstt_session_failed. It runs after the existing custom-vocabulary check, which still answers a refused vocabulary withstt_transcribe_vocabulary_rejected. The frame's English stays fixed text, because AWS's own message carries the caller's ARN.lib/sttProviders.tsmaps the new code to its own notice in all 12 catalogs underwebsite/src/i18n/locales, and the pseudolocale is regenerated. The notice points at Settings → Voice, where the AWS profile is chosen, and names the full IAM actiontranscribe:StartStreamTranscription, the string an admin pastes into a policy. The French punctuation gate (website/src/i18n/style/frStyle.test.ts, documented instyle/fr.md) skips IAM action names the way it already skips URIs and drive paths, so that colon keeps no space before it. The STT streaming spec lists the new code and why the consent gate cannot catch this case.One small correction rides along: the spec's list of transport-owned codes now names all five, including the existing
_CODE_CONSENT_REQUIREDand_CODE_VOCABULARY_REJECTEDit had left out. The before/after screenshots are committed undertemp-screenshots/dictation-access-denied/, the repository's evidence path for fork PRs.Backwards compatibility
Compatible: one new error code. An older dashboard bundle that does not know it shows the frame's English message, as it does for any unknown code.
Tests
test/test_stt_stream.py: anAccessDeniedExceptionat stream start reaches the browser asstt_aws_access_deniedwith fixed English and no ARN. A 403UnrecognizedClientException, a 500, aBadRequestExceptionand a plainRuntimeErrorkeepstt_session_failed, which pins the check to the error type rather than the status. The existing start-failure test now asserts its code.test/test_stt_stream.py: a 403 whosex-amzn-errortypeisAccessDeniedExceptionalso goes through the SDK's own error parser (TranscribeStreamingResponseParser.parse_exception) into the classifier, so anamazon-transcriberelease that models that error as its own class fails this test instead of quietly sending users back to "record again".website/src/test/SttProviders.test.ts: the pinned list of stream codes includes the new one, so it must have its own catalog sentence.Manual verification
UnknownServiceException(403, 'AccessDeniedException', ...)fromamazon-transcribe. The new backend test builds it field for field. A live AWS refusal could not be reproduced here, because every credential available in this environment may callStartStreamTranscription.website/dist), with thewebsite/scripts/lib/boot-api.mjsfixtures answering HTTP and arouteWebSocketon/api/ws/sttanswering the mic click with the exact frame each gateway sends:stt_session_failedfrom main,stt_aws_access_deniedfrom this branch. Headless Chromium has no microphone, so a silent Web Audio stream stands in for it. The real hook and notice render the text. The narrow-window capture checks wrapping.prepare-prgate floor is green, except host-dependent suites that cannot run in this environment (no Electron binary, no user service bus, a sandboxed PID namespace). None of them reads the changed files.Screenshots / video
Captured from
f1ec0c3d0: builtwebsite/dist, stubbed HTTP API, routed/api/ws/sttframes (see Manual verification).Before: what main shows when AWS refuses the stream.
After
After, narrow window
Related Issues
Fixes #15932
Pattern harvest
Rule candidate: review-prompt
Pattern: a catch-all handler that reports every provider error with one "try again" code, including refusals no retry can clear (an HTTP 403
AccessDeniedException).Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)