fix(edge): stop short clips waiting a minute on the NAS and make the OpenAI STT fallback usable
All checks were successful
ci / 정본·보안·린트·타입·테스트 (push) Successful in 52s
ci / 모바일 린트·타입·Jest (push) Successful in 41s
ci / Supabase Edge Functions + Cloudflare Worker (push) Successful in 22s
ci / .NET API 서버 테스트 (push) Successful in 14s
deploy-site / deploy (push) Successful in 41s
ci / 워크스페이스 빌드 검증 (push) Successful in 36s
All checks were successful
ci / 정본·보안·린트·타입·테스트 (push) Successful in 52s
ci / 모바일 린트·타입·Jest (push) Successful in 41s
ci / Supabase Edge Functions + Cloudflare Worker (push) Successful in 22s
ci / .NET API 서버 테스트 (push) Successful in 14s
deploy-site / deploy (push) Successful in 41s
ci / 워크스페이스 빌드 검증 (push) Successful in 36s
A five-second phone recording took over a minute: stt-proxy waited up to 60 s for the self-hosted gateway, whose GPU endpoint was off and whose NAS CPU Whisper needs 30-90 s per clip. With a direct provider configured the gateway now gets 5 s plus the clip length (30 s cap). The direct OpenAI fallback never produced a result. The production key held characters that are not valid in an HTTP header, so every request threw while being built; provider keys are now stripped of BOM/zero-width characters and a still-invalid key counts as not configured. whisper-1 verbose_json reports the language by name, which the result contract rejected; names now map to codes. Fail-closed responses list each provider's failure (status or error class, no secrets) so an outage can be diagnosed without log access.
This commit is contained in:
parent
c90946ce16
commit
0273c6abaa
11 changed files with 139 additions and 20 deletions
|
|
@ -28,6 +28,7 @@ import {
|
|||
type GenerationPurpose,
|
||||
} from '../_shared/generation-receipt.ts'
|
||||
import { buildAnthropicSystemBlocks } from '../_shared/generative-ai-safety.ts'
|
||||
import { readProviderKey } from '../_shared/provider-key.ts'
|
||||
|
||||
/** 티어별 허용 모델 — free는 Haiku만, pro는 +Sonnet, pro_plus는 +Opus, team/enterprise는 전 모델 */
|
||||
const TIER_MODELS: Record<Tier, string[]> = {
|
||||
|
|
@ -96,7 +97,7 @@ Deno.serve(async (req: Request) => {
|
|||
)
|
||||
|
||||
// A deployment without a provider must not consume quota or fabricate an answer.
|
||||
const anthropicKey = Deno.env.get('ANTHROPIC_API_KEY')?.trim() ?? ''
|
||||
const anthropicKey = readProviderKey('ANTHROPIC_API_KEY')
|
||||
if (!anthropicKey) {
|
||||
return new Response(JSON.stringify({ error: 'provider_unavailable' }), {
|
||||
status: 503,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue