From 61b975b5dd8fd25d8ddc613fef692e4369595a5e Mon Sep 17 00:00:00 2001 From: IanShaw027 Date: Fri, 7 Aug 2026 16:45:25 +0800 Subject: [PATCH] =?UTF-8?q?test(grok):=20=E5=AF=B9=E9=BD=90=E8=B7=A8?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=AB=AF=E6=98=A0=E5=B0=84=E4=B8=8E=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E5=AE=A1=E8=AE=A1=E5=A5=91=E7=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/internal/handler/openai_gateway_handler_test.go | 4 ++++ .../server/routes/prompt_audit_route_coverage_test.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/backend/internal/handler/openai_gateway_handler_test.go b/backend/internal/handler/openai_gateway_handler_test.go index 543cda1e55..bf3061d5e2 100644 --- a/backend/internal/handler/openai_gateway_handler_test.go +++ b/backend/internal/handler/openai_gateway_handler_test.go @@ -17,6 +17,7 @@ import ( "github.com/Wei-Shaw/sub2api/internal/config" pkghttputil "github.com/Wei-Shaw/sub2api/internal/pkg/httputil" "github.com/Wei-Shaw/sub2api/internal/pkg/pagination" + "github.com/Wei-Shaw/sub2api/internal/pkg/xai" "github.com/Wei-Shaw/sub2api/internal/server/middleware" "github.com/Wei-Shaw/sub2api/internal/service" coderws "github.com/coder/websocket" @@ -643,6 +644,9 @@ func TestResolveOpenAIMessagesDispatchMappedModel(t *testing.T) { }) t.Run("grok_group_maps_claude_cli_model_to_grok_default", func(t *testing.T) { + original := xai.RuntimeModelMappingOptions() + t.Cleanup(func() { xai.SetRuntimeModelMappingOptions(original) }) + xai.SetRuntimeModelMappingOptions(xai.ModelMappingOptions{EnableCrossClientMap: true}) apiKey := &service.APIKey{ Group: &service.Group{ Platform: service.PlatformGrok, diff --git a/backend/internal/server/routes/prompt_audit_route_coverage_test.go b/backend/internal/server/routes/prompt_audit_route_coverage_test.go index e4591ab4f5..4c0b583980 100644 --- a/backend/internal/server/routes/prompt_audit_route_coverage_test.go +++ b/backend/internal/server/routes/prompt_audit_route_coverage_test.go @@ -49,6 +49,10 @@ func TestEveryGatewayPOSTRouteIsClassifiedForPromptAuditCoverage(t *testing.T) { excluded := map[string]string{ "/messages/count_tokens": "tokenization only; it does not execute a model request", "/images/batches/:id/cancel": "control-plane cancellation with no user prompt", + "/tts": "voice synthesis input is not a text-generation prompt", + "/stt": "speech transcription is not a text-generation prompt", + "/custom-voices": "voice profile management has no model prompt", + "/web_search": "search query is handled by the dedicated search workflow", } unclassified := make([]string, 0)