fix(gateway): stop default redact thinking beta injection
This commit is contained in:
@@ -75,6 +75,7 @@ const CLICurrentVersion = "2.1.92"
|
|||||||
// - OAuth 账号 + 非 haiku:追加这整份列表,再按需保留 client 带来的 beta。
|
// - OAuth 账号 + 非 haiku:追加这整份列表,再按需保留 client 带来的 beta。
|
||||||
// - OAuth 账号 + haiku:Anthropic 对 haiku 不做 third-party 判定,使用 HaikuBetaHeader 即可。
|
// - OAuth 账号 + haiku:Anthropic 对 haiku 不做 third-party 判定,使用 HaikuBetaHeader 即可。
|
||||||
// - API-key 账号:不要使用本函数,参见 APIKeyBetaHeader。
|
// - API-key 账号:不要使用本函数,参见 APIKeyBetaHeader。
|
||||||
|
// - 不默认加入 redact-thinking,避免上游抹除 thinking 内容;客户端显式传入时由合并逻辑保留。
|
||||||
func FullClaudeCodeMimicryBetas() []string {
|
func FullClaudeCodeMimicryBetas() []string {
|
||||||
return []string{
|
return []string{
|
||||||
BetaClaudeCode,
|
BetaClaudeCode,
|
||||||
@@ -82,7 +83,6 @@ func FullClaudeCodeMimicryBetas() []string {
|
|||||||
BetaInterleavedThinking,
|
BetaInterleavedThinking,
|
||||||
BetaPromptCachingScope,
|
BetaPromptCachingScope,
|
||||||
BetaEffort,
|
BetaEffort,
|
||||||
BetaRedactThinking,
|
|
||||||
BetaContextManagement,
|
BetaContextManagement,
|
||||||
BetaExtendedCacheTTL,
|
BetaExtendedCacheTTL,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -124,6 +124,24 @@ func TestMergeAnthropicBetaDropping_DroppedBetas(t *testing.T) {
|
|||||||
require.Contains(t, got, "fast-mode-2026-02-01")
|
require.Contains(t, got, "fast-mode-2026-02-01")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestFullClaudeCodeMimicryBetas_DoesNotDefaultRedactThinking(t *testing.T) {
|
||||||
|
required := claude.FullClaudeCodeMimicryBetas()
|
||||||
|
|
||||||
|
require.NotContains(t, required, claude.BetaRedactThinking)
|
||||||
|
require.Contains(t, required, claude.BetaClaudeCode)
|
||||||
|
require.Contains(t, required, claude.BetaOAuth)
|
||||||
|
require.Contains(t, required, claude.BetaInterleavedThinking)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestMergeAnthropicBetaDropping_PreservesIncomingRedactThinking(t *testing.T) {
|
||||||
|
required := claude.FullClaudeCodeMimicryBetas()
|
||||||
|
incoming := claude.BetaRedactThinking
|
||||||
|
|
||||||
|
got := mergeAnthropicBetaDropping(required, incoming, droppedBetaSet())
|
||||||
|
|
||||||
|
require.Contains(t, got, claude.BetaRedactThinking)
|
||||||
|
}
|
||||||
|
|
||||||
func TestDroppedBetaSet(t *testing.T) {
|
func TestDroppedBetaSet(t *testing.T) {
|
||||||
// Base set contains DroppedBetas (now empty — filtering moved to configurable beta policy)
|
// Base set contains DroppedBetas (now empty — filtering moved to configurable beta policy)
|
||||||
base := droppedBetaSet()
|
base := droppedBetaSet()
|
||||||
|
|||||||
Reference in New Issue
Block a user