Skip to content

Commit 4e7df8d

Browse files
Bowl42claude
andauthored
feat: add proxy integration tests and fix Codex↔Gemini response converter bug (#393)
Add comprehensive end-to-end proxy integration tests covering all 4 protocol types (Claude, OpenAI, Codex, Gemini) with 20 test cases including passthrough, all 12 cross-protocol conversions, error handling, and multi-protocol coexistence. Fix a bug where Codex↔Gemini response transformers were registered with swapped implementations, causing silent data corruption: responses would be returned in the wrong format with null/zero fields instead of being properly converted. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9bca42d commit 4e7df8d

File tree

4 files changed

+1072
-2
lines changed

4 files changed

+1072
-2
lines changed

internal/converter/codex_to_gemini.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ import (
99
)
1010

1111
func init() {
12-
RegisterConverter(domain.ClientTypeCodex, domain.ClientTypeGemini, &codexToGeminiRequest{}, &codexToGeminiResponse{})
12+
// Response transformer is geminiToCodexResponse (reads Codex body → outputs Gemini body)
13+
// because responses[from][to] must convert FROM from-format TO to-format
14+
RegisterConverter(domain.ClientTypeCodex, domain.ClientTypeGemini, &codexToGeminiRequest{}, &geminiToCodexResponse{})
1315
}
1416

1517
type codexToGeminiRequest struct{}

internal/converter/gemini_to_codex.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ import (
99
)
1010

1111
func init() {
12-
RegisterConverter(domain.ClientTypeGemini, domain.ClientTypeCodex, &geminiToCodexRequest{}, &geminiToCodexResponse{})
12+
// Response transformer is codexToGeminiResponse (reads Gemini body → outputs Codex body)
13+
// because responses[from][to] must convert FROM from-format TO to-format
14+
RegisterConverter(domain.ClientTypeGemini, domain.ClientTypeCodex, &geminiToCodexRequest{}, &codexToGeminiResponse{})
1315
}
1416

1517
type geminiToCodexRequest struct{}

0 commit comments

Comments
 (0)