History

Merge pull request #2898 from octo-patch/fix/issue-2866-remove-obsolete-1m-beta-header

fix(executor): drop obsolete context-1m-2025-08-07 beta header

Luis Pater committed 6 months ago

Commit e05abec2 parents 86c856f f4eb1611 file · +1 −12Browse files

Unified · Split

internal/runtime/executor/claude_executor.go+1−12
@@ -11,7 +11,6 @@ import ( · 10 unmodified lines
11 "fmt"11 "fmt"
12 "io"12 "io"
13 "net/http"13 "net/http"
14 "net/textproto"
15 "strings"14 "strings"
16 "time"15 "time"
17 16
@@ -911,15 +910,8 @@ func applyClaudeHeaders(r *http.Request, auth *cliproxyauth.Auth, apiKey string, · 893 unmodified lines
911 baseBetas += ",interleaved-thinking-2025-05-14"910 baseBetas += ",interleaved-thinking-2025-05-14"
912 }911 }
913 912
914 hasClaude1MHeader := false
915 if ginHeaders != nil {
916 if _, ok := ginHeaders[textproto.CanonicalMIMEHeaderKey("X-CPA-CLAUDE-1M")]; ok {
917 hasClaude1MHeader = true
918 }
919 }
920
921 // Merge extra betas from request body and request flags.913 // Merge extra betas from request body and request flags.
922 if len(extraBetas) > 0 || hasClaude1MHeader {914 if len(extraBetas) > 0 {
923 existingSet := make(map[string]bool)915 existingSet := make(map[string]bool)
924 for _, b := range strings.Split(baseBetas, ",") {916 for _, b := range strings.Split(baseBetas, ",") {
925 betaName := strings.TrimSpace(b)917 betaName := strings.TrimSpace(b)
@@ -934,9 +926,6 @@ func applyClaudeHeaders(r *http.Request, auth *cliproxyauth.Auth, apiKey string, · 8 unmodified lines
934 existingSet[beta] = true926 existingSet[beta] = true
935 }927 }
936 }928 }
937 if hasClaude1MHeader && !existingSet["context-1m-2025-08-07"] {
938 baseBetas += ",context-1m-2025-08-07"
939 }
940 }929 }
941 r.Header.Set("Anthropic-Beta", baseBetas)930 r.Header.Set("Anthropic-Beta", baseBetas)
942 931