Skip to content

feat(voice): support compatible transcription endpoints - #24

Merged
benedict2310 merged 1 commit into
mainfrom
feat/configurable-transcription
Aug 26, 2026
Merged

benedict2310 merged 1 commit into
mainfrom
feat/configurable-transcription

Conversation

@benedict2310

Copy link
Copy Markdown
Owner

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.

@benedict2310
benedict2310 force-pushed the feat/configurable-transcription branch from c5840e0 to 01df5bc Compare August 26, 2026 10:00
@benedict2310
benedict2310 merged commit 7fdd867 into main Aug 26, 2026
2 checks passed
@benedict2310
benedict2310 deleted the feat/configurable-transcription branch August 26, 2026 10:02

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/voice.ts
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}]`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread .env.example
# 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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.

1 participant