From b1719b26d1f4e015f4b22683d2cdebfbb6e0267c Mon Sep 17 00:00:00 2001 From: alfadb Date: Tue, 3 Mar 2026 15:14:50 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(ops):=20=E9=BB=98=E8=AE=A4=E5=BF=BD?= =?UTF-8?q?=E7=95=A5=20count=5Ftokens=20404=20=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将 IgnoreCountTokensErrors 默认值从 false 改为 true。 count_tokens 返回 404 是预期业务行为(上游不支持 endpoint, 客户端应 fallback 到本地 tokenizer 估算),不应被视为错误。 Co-Authored-By: Claude Opus 4.6 --- backend/internal/service/ops_settings.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/internal/service/ops_settings.go b/backend/internal/service/ops_settings.go index a6a4a0d71..1fc05ab25 100644 --- a/backend/internal/service/ops_settings.go +++ b/backend/internal/service/ops_settings.go @@ -368,7 +368,7 @@ func defaultOpsAdvancedSettings() *OpsAdvancedSettings { Aggregation: OpsAggregationSettings{ AggregationEnabled: false, }, - IgnoreCountTokensErrors: false, + IgnoreCountTokensErrors: true, // count_tokens 404 是预期行为,默认忽略 IgnoreContextCanceled: true, // Default to true - client disconnects are not errors IgnoreNoAvailableAccounts: false, // Default to false - this is a real routing issue AutoRefreshEnabled: false, From 832b0185c7eadefa8774a0c4cf6644f6340dda20 Mon Sep 17 00:00:00 2001 From: alfadb Date: Tue, 3 Mar 2026 18:00:49 +0800 Subject: [PATCH 2/2] style: fix gofmt formatting in ops_settings.go Remove extra space before inline comment to pass golangci-lint gofmt check. Co-Authored-By: Claude Opus 4.6 --- backend/internal/service/ops_settings.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/internal/service/ops_settings.go b/backend/internal/service/ops_settings.go index 1fc05ab25..7514cc80f 100644 --- a/backend/internal/service/ops_settings.go +++ b/backend/internal/service/ops_settings.go @@ -368,7 +368,7 @@ func defaultOpsAdvancedSettings() *OpsAdvancedSettings { Aggregation: OpsAggregationSettings{ AggregationEnabled: false, }, - IgnoreCountTokensErrors: true, // count_tokens 404 是预期行为,默认忽略 + IgnoreCountTokensErrors: true, // count_tokens 404 是预期行为,默认忽略 IgnoreContextCanceled: true, // Default to true - client disconnects are not errors IgnoreNoAvailableAccounts: false, // Default to false - this is a real routing issue AutoRefreshEnabled: false,