From 1ecef269f7942640f0347702817cff0ea100eade Mon Sep 17 00:00:00 2001 From: shaw Date: Tue, 30 Dec 2025 23:07:25 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E5=8E=BB=E9=99=A4openai-apkey?= =?UTF-8?q?=E8=B4=A6=E6=88=B7=E8=AF=B7=E6=B1=82=E8=B7=AF=E5=BE=84=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E7=9A=84v1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 25 ------------------- .../internal/service/account_test_service.go | 2 +- .../service/openai_gateway_service.go | 2 +- build_image.sh | 0 4 files changed, 2 insertions(+), 27 deletions(-) delete mode 100644 AGENTS.md mode change 100755 => 100644 build_image.sh diff --git a/AGENTS.md b/AGENTS.md deleted file mode 100644 index 99e1f981..00000000 --- a/AGENTS.md +++ /dev/null @@ -1,25 +0,0 @@ - -# OpenSpec Instructions - -These instructions are for AI assistants working in this project. - -Always open `@/openspec/AGENTS.md` when the request: -- Mentions planning or proposals (words like proposal, spec, change, plan) -- Introduces new capabilities, breaking changes, architecture shifts, or big performance/security work -- Sounds ambiguous and you need the authoritative spec before coding - -Use `@/openspec/AGENTS.md` to learn: -- How to create and apply change proposals -- Spec format and conventions -- Project structure and guidelines - -Keep this managed block so 'openspec update' can refresh the instructions. - - - -## 强制语言规范 - -以下为强制规定: -- 与用户交流一律使用中文。 -- 代码文档与代码注释一律使用中文。 -- OpenSpec 提案与相关说明一律使用中文。 diff --git a/backend/internal/service/account_test_service.go b/backend/internal/service/account_test_service.go index 6296f2fe..c62b4210 100644 --- a/backend/internal/service/account_test_service.go +++ b/backend/internal/service/account_test_service.go @@ -328,7 +328,7 @@ func (s *AccountTestService) testOpenAIAccountConnection(c *gin.Context, account if baseURL == "" { baseURL = "https://api.openai.com" } - apiURL = strings.TrimSuffix(baseURL, "/") + "/v1/responses" + apiURL = strings.TrimSuffix(baseURL, "/") + "/responses" } else { return s.sendErrorAndEnd(c, fmt.Sprintf("Unsupported account type: %s", account.Type)) } diff --git a/backend/internal/service/openai_gateway_service.go b/backend/internal/service/openai_gateway_service.go index 79801b29..2bb0bee8 100644 --- a/backend/internal/service/openai_gateway_service.go +++ b/backend/internal/service/openai_gateway_service.go @@ -371,7 +371,7 @@ func (s *OpenAIGatewayService) buildUpstreamRequest(ctx context.Context, c *gin. // API Key accounts use Platform API or custom base URL baseURL := account.GetOpenAIBaseURL() if baseURL != "" { - targetURL = baseURL + "/v1/responses" + targetURL = baseURL + "/responses" } else { targetURL = openaiPlatformAPIURL } diff --git a/build_image.sh b/build_image.sh old mode 100755 new mode 100644 From 4319cf7f31ceca863fa8674bb6309a03ed1ad1d1 Mon Sep 17 00:00:00 2001 From: shaw Date: Tue, 30 Dec 2025 23:11:49 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(=E4=BB=93=E5=82=A8):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=20BatchUpdateLastUsed=20=E6=97=B6=E9=97=B4=E6=88=B3?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E4=B8=8D=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在原生 SQL 的 CASE WHEN 语句中,PostgreSQL 无法自动推断占位符参数类型, 导致 time.Time 被当作 text 类型处理,与 last_used_at 列的 timestamptz 类型不匹配。 添加显式类型转换 ::timestamptz 解决此问题。 --- backend/internal/repository/account_repo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/internal/repository/account_repo.go b/backend/internal/repository/account_repo.go index 19dff447..aa880269 100644 --- a/backend/internal/repository/account_repo.go +++ b/backend/internal/repository/account_repo.go @@ -334,7 +334,7 @@ func (r *accountRepository) BatchUpdateLastUsed(ctx context.Context, updates map idx := 1 for id, ts := range updates { - caseSQL += " WHEN $" + itoa(idx) + " THEN $" + itoa(idx+1) + caseSQL += " WHEN $" + itoa(idx) + " THEN $" + itoa(idx+1) + "::timestamptz" args = append(args, id, ts) ids = append(ids, id) idx += 2