test(openai): passthrough 모델 alias 설명을 정리한다

This commit is contained in:
toki 2026-07-08 16:24:01 +09:00
parent 909f916df8
commit c747c395cf

View file

@ -4492,8 +4492,9 @@ func chatPassthroughServer(providerURL string) (*Server, *fakeRunService) {
}
// TestChatCompletionsPassthroughNonStreamingByteIdentity verifies SDD S04 for
// the non-streaming path: with omitted response mode, the caller receives the
// provider JSON body byte-identically, along with provider status and headers.
// the non-streaming path: when the provider omits a top-level model echo, the
// caller receives the provider JSON body byte-identically, along with provider
// status and headers.
func TestChatCompletionsPassthroughNonStreamingByteIdentity(t *testing.T) {
// Provider-original body with fields the normalized path would rewrite or
// drop (reasoning_content, provider-specific key order and spacing).
@ -4592,7 +4593,8 @@ func TestChatCompletionsPassthroughNonStreamingRewritesModelEcho(t *testing.T) {
// TestChatCompletionsPassthroughProviderPoolGenerationPolicy verifies that
// provider-pool omitted-mode passthrough requests apply the catalog entry's
// generation policy (default_max_tokens, min_max_tokens, default_thinking_token_budget)
// before dispatching to the provider.
// before dispatching to the provider. The fixture omits a top-level model echo,
// so the response body remains byte-identical.
func TestChatCompletionsPassthroughProviderPoolGenerationPolicy(t *testing.T) {
providerBody := `{"id":"cmpl-provider-1","object":"chat.completion","choices":[{"index":0,"message":{"role":"assistant","content":"hi"},"finish_reason":"stop"}]}`
var gotProviderReq []byte
@ -4662,10 +4664,9 @@ func TestChatCompletionsPassthroughProviderPoolGenerationPolicy(t *testing.T) {
}
// TestChatCompletionsPassthroughStreamingByteIdentity verifies SDD S04 for the
// streaming path: provider SSE bytes (including provider-specific fields like
// reasoning_content and native tool_calls chunks) reach the caller
// with provider fields preserved except the top-level model echo, which is
// normalized back to the caller-facing model alias.
// streaming path: provider SSE bytes without top-level model echoes, including
// provider-specific fields like reasoning_content and native tool_calls chunks,
// reach the caller byte-identically.
func TestChatCompletionsPassthroughStreamingByteIdentity(t *testing.T) {
providerBody := "data: {\"choices\":[{\"delta\":{\"role\":\"assistant\"}}]}\n\n" +
"data: {\"choices\":[{\"delta\":{\"reasoning_content\":\"thinking...\"}}]}\n\n" +
@ -5102,9 +5103,9 @@ func TestChatCompletionsPassthroughProviderErrorAfterStartStopsBodyWrites(t *tes
}
// TestChatCompletionsPassthroughSlowClientByteIdentity verifies a slow caller
// applies backpressure without corrupting the relay: every body frame reaches
// the caller exactly once, in order, byte-identically, and a slow-but-alive
// client never triggers CancelRun.
// applies backpressure without corrupting opaque relay data: every body frame
// reaches the caller exactly once, in order, and a slow-but-alive client never
// triggers CancelRun.
func TestChatCompletionsPassthroughSlowClientByteIdentity(t *testing.T) {
const chunkCount = 40
var want strings.Builder