on main help sign in
chore: clone headers
f1b0dbbKujtim Hoxha
internal/agent/coordinator.go+3−1
@@ -9,6 +9,7 @@ import (
9 "fmt"
9 "fmt"
10 "io"
10 "io"
11 "log/slog"
11 "log/slog"
12+ "maps"
12 "os"
13 "os"
13 "slices"
14 "slices"
14 "strings"
15 "strings"
@@ -629,7 +630,7 @@ func (c *coordinator) isAnthropicThinking(model config.SelectedModel) bool {
629}
630}
630
631
631func (c *coordinator) buildProvider(providerCfg config.ProviderConfig, model config.SelectedModel) (fantasy.Provider, error) {
632func (c *coordinator) buildProvider(providerCfg config.ProviderConfig, model config.SelectedModel) (fantasy.Provider, error) {
632− headers := providerCfg.ExtraHeaders
633+ headers := maps.Clone(providerCfg.ExtraHeaders)
633
634
634 // handle special headers for anthropic
635 // handle special headers for anthropic
635 if providerCfg.Type == anthropic.Name && c.isAnthropicThinking(model) {
636 if providerCfg.Type == anthropic.Name && c.isAnthropicThinking(model) {
@@ -639,6 +640,7 @@ func (c *coordinator) buildProvider(providerCfg config.ProviderConfig, model con
639 headers["anthropic-beta"] = "interleaved-thinking-2025-05-14"
640 headers["anthropic-beta"] = "interleaved-thinking-2025-05-14"
640 }
641 }
641 }
642 }
643+ slog.Info("Headers", "headers", headers)
642
644
643 // TODO: make sure we have
645 // TODO: make sure we have
644 apiKey, _ := c.cfg.Resolve(providerCfg.APIKey)
646 apiKey, _ := c.cfg.Resolve(providerCfg.APIKey)