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
1111 "fmt"
1212 "io"
1313 "net/http"
14− "net/textproto"
1514 "strings"
1615 "time"
1716
@@ -911,15 +910,8 @@ func applyClaudeHeaders(r *http.Request, auth *cliproxyauth.Auth, apiKey string, · 893 unmodified lines
911910 baseBetas += ",interleaved-thinking-2025-05-14"
912911 }
913912
914− hasClaude1MHeader := false
915− if ginHeaders != nil {
916− if _, ok := ginHeaders[textproto.CanonicalMIMEHeaderKey("X-CPA-CLAUDE-1M")]; ok {
917− hasClaude1MHeader = true
918− }
919− }
920−
921913 // Merge extra betas from request body and request flags.
922− if len(extraBetas) > 0 || hasClaude1MHeader {
914+ if len(extraBetas) > 0 {
923915 existingSet := make(map[string]bool)
924916 for _, b := range strings.Split(baseBetas, ",") {
925917 betaName := strings.TrimSpace(b)
@@ -934,9 +926,6 @@ func applyClaudeHeaders(r *http.Request, auth *cliproxyauth.Auth, apiKey string, · 8 unmodified lines
934926 existingSet[beta] = true
935927 }
936928 }
937− if hasClaude1MHeader && !existingSet["context-1m-2025-08-07"] {
938− baseBetas += ",context-1m-2025-08-07"
939− }
940929 }
941930 r.Header.Set("Anthropic-Beta", baseBetas)
942931