on main help sign in
fix: address panic due to possible `nil` map (#1348)
commitf6e82a40baf297c757ca9ff7f0c8749f6192ca43 authorAndrey Nering <andreynering@users.noreply.github.com> dateFri 31 Oct 2025, 10:40 (1 year ago) parent83acb62
1 file changed+3
internal/agent/coordinator.go+3
internal/agent/coordinator.go+3
@@ -654,6 +654,9 @@ func (c *coordinator) isAnthropicThinking(model config.SelectedModel) bool {
654654
655655func (c *coordinator) buildProvider(providerCfg config.ProviderConfig, model config.SelectedModel) (fantasy.Provider, error) {
656656 headers := maps.Clone(providerCfg.ExtraHeaders)
657+ if headers == nil {
658+ headers = make(map[string]string)
659+ }
657660
658661 // handle special headers for anthropic
659662 if providerCfg.Type == anthropic.Name && c.isAnthropicThinking(model) {