fix(proxy): thinking rectifiers

This commit is contained in:
YoVinchen
2026-02-12 22:17:17 +08:00
parent 579df5ad99
commit 07d00e726e
10 changed files with 203 additions and 132 deletions
+5 -1
View File
@@ -141,7 +141,11 @@ function App() {
// Fallback from sessions view when switching to an app without session support
useEffect(() => {
if (currentView === "sessions" && activeApp !== "claude" && activeApp !== "codex") {
if (
currentView === "sessions" &&
activeApp !== "claude" &&
activeApp !== "codex"
) {
setCurrentView("providers");
}
}, [activeApp, currentView]);
@@ -8,9 +8,9 @@ import { settingsApi, type RectifierConfig } from "@/lib/api/settings";
export function RectifierConfigPanel() {
const { t } = useTranslation();
const [config, setConfig] = useState<RectifierConfig>({
enabled: false,
requestThinkingSignature: false,
requestThinkingBudget: false,
enabled: true,
requestThinkingSignature: true,
requestThinkingBudget: true,
});
const [isLoading, setIsLoading] = useState(true);
+1 -1
View File
@@ -216,7 +216,7 @@
"thinkingSignature": "Thinking Signature Rectification",
"thinkingSignatureDescription": "When an Anthropic-type provider returns thinking signature incompatibility or illegal request errors, automatically removes incompatible thinking-related blocks and retries once with the same provider",
"thinkingBudget": "Thinking Budget Rectification",
"thinkingBudgetDescription": "When an Anthropic-type provider returns budget_tokens constraint errors (such as at least 1024 or less than max_tokens), and the request explicitly enables thinking (type=enabled), automatically sets thinking budget to 32000 and max_tokens to 64000 if needed, then retries once"
"thinkingBudgetDescription": "When an Anthropic-type provider returns budget_tokens constraint errors (such as at least 1024), automatically normalizes thinking to enabled, sets thinking budget to 32000, and raises max_tokens to 64000 if needed, then retries once"
},
"logConfig": {
"title": "Log Management",
+1 -1
View File
@@ -216,7 +216,7 @@
"thinkingSignature": "Thinking 署名整流",
"thinkingSignatureDescription": "Anthropic タイプのプロバイダーが thinking 署名の非互換性や不正なリクエストエラーを返した場合、互換性のない thinking 関連ブロックを自動削除し、同じプロバイダーで 1 回リトライします",
"thinkingBudget": "Thinking Budget 整流",
"thinkingBudgetDescription": "Anthropic タイプのプロバイダーが budget_tokens 制約エラー(例: 1024 以上、max_tokens 未満)を返し、かつリクエストで thinkingtype=enabled)が明示的に有効な場合、thinking 予算を 32000 に設定し、必要に応じて max_tokens を 64000 に設定して 1 回リトライします"
"thinkingBudgetDescription": "Anthropic タイプのプロバイダーが budget_tokens 制約エラー(例: 1024 以上)を返した場合、thinkingenabled に正規化し、thinking 予算を 32000 に設定し、必要に応じて max_tokens を 64000 に引き上げて 1 回リトライします"
},
"logConfig": {
"title": "ログ管理",
+1 -1
View File
@@ -216,7 +216,7 @@
"thinkingSignature": "Thinking 签名整流",
"thinkingSignatureDescription": "当 Anthropic 类型供应商返回 thinking 签名不兼容或非法请求等错误时,自动移除不兼容的 thinking 相关块并对同一供应商重试一次",
"thinkingBudget": "Thinking Budget 整流",
"thinkingBudgetDescription": "当 Anthropic 类型供应商返回 budget_tokens 约束错误(如至少 1024、需小于 max_tokens)时,在请求显式开启 thinkingtype=enabled)时自动将预算设为 32000在需要时将 max_tokens 设为 64000,然后重试一次"
"thinkingBudgetDescription": "当 Anthropic 类型供应商返回 budget_tokens 约束错误(如至少 1024)时,自动将 thinking 规范为 enabled 并将 budget 设为 32000同时在需要时将 max_tokens 设为 64000,然后重试一次"
},
"logConfig": {
"title": "日志管理",