From f1b0dbb476efd7379aa6502469f742b3b2880baa Mon Sep 17 00:00:00 2001 From: Kujtim Hoxha Date: Sun, 26 Oct 2025 17:33:13 +0100 Subject: [PATCH] chore: clone headers --- internal/agent/coordinator.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/agent/coordinator.go b/internal/agent/coordinator.go index ae9c20ba80320c020116ffd5929197eb215c8239..da9b535fcbe773ddedbbabad068ad03afd4503bc 100644 --- a/internal/agent/coordinator.go +++ b/internal/agent/coordinator.go @@ -9,6 +9,7 @@ import ( "fmt" "io" "log/slog" + "maps" "os" "slices" "strings" @@ -629,7 +630,7 @@ func (c *coordinator) isAnthropicThinking(model config.SelectedModel) bool { } func (c *coordinator) buildProvider(providerCfg config.ProviderConfig, model config.SelectedModel) (fantasy.Provider, error) { - headers := providerCfg.ExtraHeaders + headers := maps.Clone(providerCfg.ExtraHeaders) // handle special headers for anthropic if providerCfg.Type == anthropic.Name && c.isAnthropicThinking(model) { @@ -639,6 +640,7 @@ func (c *coordinator) buildProvider(providerCfg config.ProviderConfig, model con headers["anthropic-beta"] = "interleaved-thinking-2025-05-14" } } + slog.Info("Headers", "headers", headers) // TODO: make sure we have apiKey, _ := c.cfg.Resolve(providerCfg.APIKey)