From 64ae6e206bfa12fc2c11713c4e115d247f3cb957 Mon Sep 17 00:00:00 2001 From: yetone Date: Fri, 20 Nov 2026 11:40:19 +0800 Subject: [PATCH] gateway: /responses/compact is held to a key's MaxConcurrency and refused a read-only key (#7281) 6e6da86c8 added POST /v1/responses/compact and /responses/compact without judging them in the two every-route guards, so the full gateway suite went red on TestKeySlotEveryRoute and TestReadOnlyKeyEveryRoute. Both routes ask a model through serve's tries as /responses does, so they are keySlotLazy in keySlotRoutes and in readOnlyRefused (the guard already refused them; only the test list was missing them). Run on mote at this tree: - go test ./internal/gateway -count=1 -timeout 45m at 6e6da86c8: FAIL, with TestKeySlotEveryRoute and TestReadOnlyKeyEveryRoute (the two fixed here) and TestOpenCodeGoOwnFreeModelGetsNothingOfOpenCodes, which is red 3 of 3 on origin/main c2924c36d alone (#7117). Its log also has the recovered doneHold "close of closed channel" panic (#6505, #6690). - -run 'TestKeySlotEveryRoute|TestReadOnlyKeyEveryRoute| TestResponsesCompact|TestBrowserKey' -count=1: ok. - gofmt -l internal/gateway: clean. Not run: the full gateway suite again at this head. --- internal/gateway/key_slots.go | 2 ++ internal/gateway/readonly_test.go | 1 + 2 files changed, 3 insertions(+) diff --git a/internal/gateway/key_slots.go b/internal/gateway/key_slots.go index 742177a1f..575b75ffb 100644 --- a/internal/gateway/key_slots.go +++ b/internal/gateway/key_slots.go @@ -51,6 +51,8 @@ var keySlotRoutes = map[string]keySlotKind{ "POST /chat/completions": keySlotLazy, "POST /v1/responses": keySlotLazy, "POST /responses": keySlotLazy, + "POST /v1/responses/compact": keySlotLazy, + "POST /responses/compact": keySlotLazy, "POST /v1/messages": keySlotLazy, "POST /messages": keySlotLazy, "POST /api/chat": keySlotLazy, diff --git a/internal/gateway/readonly_test.go b/internal/gateway/readonly_test.go index ca52aef8c..9968444e5 100644 --- a/internal/gateway/readonly_test.go +++ b/internal/gateway/readonly_test.go @@ -48,6 +48,7 @@ var readOnlyRefused = []string{ // models, a WebSocket's upgrade and count_tokens among them "POST /v1/chat/completions", "POST /chat/completions", "POST /v1/responses", "POST /responses", "GET /v1/responses", "GET /responses", + "POST /v1/responses/compact", "POST /responses/compact", "POST /v1/messages", "POST /messages", "POST /v1/systemone", "POST /v1" + AlphaSearchPath, "POST " + AlphaSearchPath, "POST /v1/messages/count_tokens", "POST /v1/images/generations", "POST /images/generations", "POST /v1/images/edits", "POST /images/edits",