@@ -9,6 +9,7 @@ import (
99 "fmt"
1010 "io"
1111 "log/slog"
12+ "maps"
1213 "os"
1314 "slices"
1415 "strings"
@@ -629,7 +630,7 @@ func (c *coordinator) isAnthropicThinking(model config.SelectedModel) bool {
629630}
630631
631632func (c *coordinator) buildProvider(providerCfg config.ProviderConfig, model config.SelectedModel) (fantasy.Provider, error) {
632− headers := providerCfg.ExtraHeaders
633+ headers := maps.Clone(providerCfg.ExtraHeaders)
633634
634635 // handle special headers for anthropic
635636 if providerCfg.Type == anthropic.Name && c.isAnthropicThinking(model) {
@@ -639,6 +640,7 @@ func (c *coordinator) buildProvider(providerCfg config.ProviderConfig, model con
639640 headers["anthropic-beta"] = "interleaved-thinking-2025-05-14"
640641 }
641642 }
643+ slog.Info("Headers", "headers", headers)
642644
643645 // TODO: make sure we have
644646 apiKey, _ := c.cfg.Resolve(providerCfg.APIKey)