From 41e322c53d7b4b796eb377d0df9c29ecd10ba431 Mon Sep 17 00:00:00 2001 From: Chia Date: Thu, 6 Aug 2026 09:29:41 +1200 Subject: feat: complete commercial control plane, billing, auth, and model catalog - add PostgreSQL control-plane persistence with Redis-degraded hot reload - implement prepaid balance, usage ledger, Stripe top-up and reconciliation - add registration, email verification, password reset, invitations and RBAC - support TOTP, Passkey MFA, device sessions, quotas and rate limits - add tenant billing profiles, audit logs and operational readiness checks - build authenticated admin console, Quickstart, Playground and usage analytics - add public model catalog with pricing, filtering and cost estimation - support OpenAI Responses providers and provider health failover - validate real upstream usage reporting and balance settlement --- internal/provider/forwarder_test.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'internal/provider/forwarder_test.go') diff --git a/internal/provider/forwarder_test.go b/internal/provider/forwarder_test.go index 2e9b4a1..e9751ce 100644 --- a/internal/provider/forwarder_test.go +++ b/internal/provider/forwarder_test.go @@ -37,3 +37,24 @@ func TestRewriteRequestDoesNotAddStreamOptionsToAnthropic(t *testing.T) { t.Fatalf("unexpected OpenAI stream options in Anthropic request: %s", result) } } + +func TestResponsesWireAPIUsesResponsesEndpointWithoutChatStreamOptions(t *testing.T) { + result, err := rewriteRequestWithWireAPI([]byte(`{"model":"public/model","input":"hello","stream":true}`), "gpt-upstream", domain.ProtocolOpenAIResponses, "responses") + if err != nil { + t.Fatal(err) + } + var body map[string]json.RawMessage + if err := json.Unmarshal(result, &body); err != nil { + t.Fatal(err) + } + if string(body["model"]) != `"gpt-upstream"` { + t.Fatalf("model was not rewritten: %s", result) + } + if _, exists := body["stream_options"]; exists { + t.Fatalf("Responses request contains Chat Completions stream options: %s", result) + } + provider := domain.Provider{BaseURL: "https://example.test", Protocol: domain.ProtocolOpenAI, WireAPI: "responses"} + if got := endpointURL(provider, domain.ProtocolOpenAIResponses); got != "https://example.test/responses" { + t.Fatalf("endpoint URL = %q", got) + } +} -- cgit v1.2.3