Auto-translate: add support for OpenCode Go (OpenAI-compatible, requires custom "x-opencode-session" header)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
Start by locating the auto-translate engine implementations — the existing ChatGPT / OpenAI-compatible engine that already parses OpenAI-shaped responses — and the engine picker plus the settings model where the API key and endpoint URL are persisted. Reproduce the HTTP 400 by pointing that engine at https://opencode.ai/inference/go/openai/v1/chat/completions with an oc_sk_ key, then confirm the /v1/models list loads without auth. The cheapest path is the issue's option 2: a free-text "extra headers" field on the generic engine, appended to the outgoing request, with a generated x-opencode-session value saved in settings. Done looks like: any engine can send configured headers, the session id survives a restart, and a translation round-trip against the OpenCode Go endpoint succeeds.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
OpenCode Go is a low-cost subscription from OpenCode giving access to a curated set of strong open models (GLM-5.3(-Flash), DeepSeek V4, Kimi K3, MiniMax, Qwen, etc.) via standard OpenAI-compatible endpoints. It would work as an auto-translate provider, but requests fail because of one required custom HTTP header that Subtitle Edit cannot send.
Endpoint
- Chat Completions:
https://opencode.ai/inference/go/openai/v1/chat/completions - Model list (no auth):
https://opencode.ai/inference/go/v1/models - Auth:
Authorization: Bearer <key>(keys look likeoc_sk_..., from the Console)
The blocker
OpenCode Go requires a stable session id header on every request:
x-opencode-session: <stable id, e.g. a persisted GUID>
Without it the gateway answers HTTP 400:
{
"type": "error",
"error": {
"type": "MissingSessionID",
"message": "Request is missing x-opencode-session and cannot be routed efficiently."
}
}
Subtitle Edit's auto-translate engines cannot send custom HTTP headers, so the request fails even with URL, key and model configured correctly. With the header present, the endpoint returns a normal OpenAI-shaped response that SE's ChatGPT / OpenAI-compatible engines already parse fine.
Feature request
Any of these would enable it (in order of preference):
1. A dedicated "OpenCode Go" engine — fixed URL, API key field, model dropdown from /v1/models, and automatic x-opencode-session with a generated id persisted in settings.
2. Optional extra HTTP headers on the generic OpenAI-compatible / ChatGPT engine (one Name: value per line). Useful for other gateways requiring tenant/project headers too.
3. Minimal: send a generated x-opencode-session automatically from the OpenAI-compatible engine when the configured URL points at opencode.ai.
Docs: https://opencode.ai/docs/console/go/ · https://opencode.ai/docs/console/harnesses/
- Lingua principale
- C#
- Stelle
- 15.1k
- Fork
- 1.4k
- Merge medio
- 1h 58m
- PR unite (30g)
- 564
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di SubtitleEdit/subtitleedit
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
SubtitleEdit/subtitleedit#17247 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
SubtitleEdit/subtitleedit#16699 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
SubtitleEdit/subtitleedit#16374 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
SubtitleEdit/subtitleedit#14510 · 3 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 44/100
SubtitleEdit/subtitleedit#17244 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di SubtitleEdit/subtitleedit
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno
-
Restore test cleanup fails on Windows when restored files are read-onlyForse già presa @JamBalaya56562 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
duplicati/duplicati#8046 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Bundles Documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
pyrevitlabs/pyRevit#4285 ·
I maintainer di solito rispondono entro 1 giorno
-
customer-reported
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni