mirror of
https://github.com/musistudio/claude-code-router.git
synced 2026-10-31 12:04:59 +08:00
OpenCode Go now requires x-opencode-session on requests to https://opencode.ai/zen/go/v1; without it users receive 400 MissingSessionID (#1754, #1780). Injecting that header safely requires CCR to know which provider is really Go, so OpenCode Go is now a distinct local provider from Zen when reading OpenCode configuration, credentials, and cached catalog metadata. - Read opencode and opencode-go entries independently from models.json, opencode.json[c], auth.json, and OPENCODE_GO_API_KEY. - Add x-opencode-session only for the official Go endpoint: explicit configuration wins, otherwise forward x-claude-code-session-id or x-claude-session-id, then metadata.user_id, then a stable process-level fallback; values are sanitized for header safety. - Keep Zen discovery/import unchanged, including public models, candidate ids, fallback models, plugin suffixes, and the model cap. - Keep Go and Zen separately importable and scope provider model discovery to the requested protocol so Go providers only list models that work on that protocol. - Preserve catalog model ids, display names, and protocol classification; surface locked Go candidates with actionable guidance; update EN/ZH docs.