Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(cc-proxy): 档位恢复规则主匹配时不叠加其它清理规则(#5056 review)
ficowang980068c665c6
diff --git a/packages/anthropic-compat-proxy/src/anthropic-effort-compatibility.test.ts b/packages/anthropic-compat-proxy/src/anthropic-effort-compatibility.test.tsindex 48e87eb97e..29ad234306 100644--- a/packages/anthropic-compat-proxy/src/anthropic-effort-compatibility.test.ts+++ b/packages/anthropic-compat-proxy/src/anthropic-effort-compatibility.test.ts@@ -59,6 +59,8 @@ describe('Anthropic Messages effort compatibility (#5032)', () => {expect(rule.matches('{"error":{"message":"Unexpected message role."}}')).toBe(false);expect(rule.matches('{"error":{"message":"messages.0.output_config: Extra inputs are not permitted"}}')).toBe(false);expect(rule.applyOnUnmatchedRetry).toBe(false);+ // 主匹配时不叠加其它清理规则,重试只省略 effort、不改写工具调用历史。+ expect(rule.allowExtraRules).toBe(false);});it('strips the effort from a matched body and declines bodies with nothing to change', () => {diff --git a/packages/model-compat/src/cindy/proxy/anthropic-effort-compatibility.ts b/packages/model-compat/src/cindy/proxy/anthropic-effort-compatibility.tsindex 03237dfaca..9ea5f177e2 100644--- a/packages/model-compat/src/cindy/proxy/anthropic-effort-compatibility.ts+++ b/packages/model-compat/src/cindy/proxy/anthropic-effort-compatibility.ts@@ -47,5 +47,8 @@ export function createAnthropicEffortCompatibilityRule(): RecoveryRule {},// 语义绑在特定网关的拒绝文本上,别的 400 重试时不能顺手删掉用户档位。applyOnUnmatchedRetry: false,+ // 网关只拒绝了档位:本规则作主匹配时不叠加 encrypted_content 等其它清理,+ // 否则重试会顺手改写工具调用历史里网关并未拒绝的字段(review P1)。+ allowExtraRules: false,};}