Repository navigation
feat(voice): support compatible transcription endpoints - #24
Conversation
c5840e0 to
01df5bc
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c5840e09a1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const errorText = (await response.text().catch(() => "")).trim(); | ||
| throw new Error( | ||
| `OpenAI transcription failed (${response.status}): ${errorText || response.statusText || "Unknown error"}`, | ||
| `OpenAI transcription failed (${response.status}): ${errorText || response.statusText || "Unknown error"} [endpoint: ${endpoint.display}]`, |
There was a problem hiding this comment.
Redact endpoint secrets from HTTP error bodies
When a compatible endpoint authenticates through URL credentials or a query token and its non-2xx response echoes the request URL, this interpolation includes those secrets verbatim in the error subsequently sent to Telegram. The separately appended endpoint label is sanitized, but errorText and response.statusText bypass redactEndpointFromMessage; sanitize the selected error detail before constructing the message.
AGENTS.md reference: AGENTS.md:L21-L22
Useful? React with 👍 / 👎.
| # TELEPI_TRANSCRIPTION_API_KEY=... # falls back to OPENAI_API_KEY | ||
| # TELEPI_TRANSCRIPTION_URL=https://provider.example/v1/audio/transcriptions | ||
| # TELEPI_TRANSCRIPTION_MODEL=provider-model-name | ||
| # TELEPI_TRANSCRIPTION_AUTH_HEADER=api-key # optional; defaults to Authorization: Bearer |
There was a problem hiding this comment.
Move the auth-header explanation off the assignment
When an installed-mode user copies this file and enables the option by removing the leading #, TelePi's loadEnvFile parser does not strip inline comments, so the header name becomes api-key # optional; defaults to Authorization: Bearer. Node rejects that as an invalid HTTP header name and every transcription request fails; put the explanation on its own comment line or add inline-comment parsing.
Useful? React with 👍 / 👎.
Reimplements the useful configuration flexibility from #22 as a focused, current-main change.\n\n- preserves OpenAI defaults and OPENAI_API_KEY fallback\n- supports configurable endpoint, model, API key, auth-header, and optional transcription prompt\n- validates HTTP(S) endpoints and redacts URL credentials, query strings, and fragments—including in transport error messages\n- documents the configuration and adds focused regression coverage\n\nValidation: npm test (439 passing), npm run test:coverage (thresholds met), npm run build.