#272

feat: add OrcaRouter as a named AI channel provider

OpenJinhaoSong322wants to merge intofrom

Summary

Add OrcaRouter as a first-class named AI-channel provider. OrcaRouter is an OpenAI-compatible gateway at https://api.orcarouter.ai/v1 whose model IDs such as orcarouter/auto are routed by the gateway to the best available backend model. It also runs gateway-level, zero-trust security for AI agents on the same endpoint — screening every prompt/response and governing every tool call on a default-deny basis, with no application code changes.

Since OrcaRouter is OpenAI-compatible, channels pointing at it route through the existing OpenAI-compatible runtime path; this PR makes it a named, selectable provider instead of requiring a manually-entered base URL.

What changed

  • internal/config: add OrcaRouterBaseURL const and IsOrcaRouterProvider / IsOrcaRouterProviderName / OrcaRouterBaseURLFor helpers, plus unit tests.
  • internal/handler: default the OpenAI-compatible base URL to https://api.orcarouter.ai/v1 when provider is orcarouter in TestOpenAI, ListModels, and TestVision; update the OpenAPI spec provider description.
  • web: add OrcaRouter to the AI-channel, vision, and HITL-audit provider dropdowns; channel label display; i18n keys (en-US, zh-CN).
  • docs: document the orcarouter provider and a sample channel in config.example.yaml, README.md, README_CN.md, and the EN/CN configuration references.

How it was verified

  • go build ./... and go vet pass.
  • go test ./internal/config/... passes (including the new OrcaRouter helper tests). Handler-package tests can't run in this container because go-sqlite3 requires cgo and there is no gcc; the failures are pre-existing environment issues unrelated to this change.
  • gofmt clean; frontend JSON validated and settings.js passes node --check.
  • Live check against the gateway with the provider path (provider=orcarouter, empty base URL → https://api.orcarouter.ai/v1):
    • POST /chat/completions with orcarouter/auto → HTTP 200, assistant reply ORCA-OK.
    • GET /models → HTTP 200, 205 models.

Disclosure: I'm an engineer on the OrcaRouter team.