From 416001ca39a4b94ad7abeada9b27e01da28e1193 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Oct 2026 13:26:52 +0800 Subject: [PATCH] Fix Codex Responses API base URL Co-Authored-By: Claude Opus 5 --- internal/gateway/gateway_test.go | 2 +- internal/gateway/handlers.go | 2 +- src/pages/Codex.test.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/gateway/gateway_test.go b/internal/gateway/gateway_test.go index 8d85312..310e017 100644 --- a/internal/gateway/gateway_test.go +++ b/internal/gateway/gateway_test.go @@ -331,7 +331,7 @@ func TestApplyAndRestoreCodex(t *testing.T) { t.Fatalf("injection = %v", out["injection"]) } table := injection["table"].(map[string]any) - if table["wire_api"] != "responses" || table["base_url"] != "http://127.0.0.1:18787" { + if table["wire_api"] != "responses" || table["base_url"] != "http://127.0.0.1:18787/v1" { t.Errorf("injected table = %v", table) } if table["experimental_bearer_token"] != env.store.Config().RelayToken { diff --git a/internal/gateway/handlers.go b/internal/gateway/handlers.go index 8265ebb..1e51ebc 100644 --- a/internal/gateway/handlers.go +++ b/internal/gateway/handlers.go @@ -235,7 +235,7 @@ func (s *Server) applyCodex(w http.ResponseWriter, id string) { return } injection, err := mgr.Apply(codexcfg.ApplyOptions{ - BaseURL: fmt.Sprintf("http://127.0.0.1:%d", s.port), + BaseURL: fmt.Sprintf("http://127.0.0.1:%d/v1", s.port), Token: s.store.Config().RelayToken, }) if err != nil { diff --git a/src/pages/Codex.test.tsx b/src/pages/Codex.test.tsx index 6ebfb7d..3537d52 100644 --- a/src/pages/Codex.test.tsx +++ b/src/pages/Codex.test.tsx @@ -65,7 +65,7 @@ beforeEach(() => { table: { name: "crossrelay", wire_api: "responses", - base_url: "http://127.0.0.1:52917", + base_url: "http://127.0.0.1:52917/v1", experimental_bearer_token: "crl_x", requires_openai_auth: "false", },