on main help sign in
fix: address panic due to possible `nil` map (#1348)
f6e82a4Andrey Nering
internal/agent/coordinator.go+3
@@ -654,6 +654,9 @@ func (c *coordinator) isAnthropicThinking(model config.SelectedModel) bool {
654
654
655func (c *coordinator) buildProvider(providerCfg config.ProviderConfig, model config.SelectedModel) (fantasy.Provider, error) {
655func (c *coordinator) buildProvider(providerCfg config.ProviderConfig, model config.SelectedModel) (fantasy.Provider, error) {
656 headers := maps.Clone(providerCfg.ExtraHeaders)
656 headers := maps.Clone(providerCfg.ExtraHeaders)
657+ if headers == nil {
658+ headers = make(map[string]string)
659+ }
657
660
658 // handle special headers for anthropic
661 // handle special headers for anthropic
659 if providerCfg.Type == anthropic.Name && c.isAnthropicThinking(model) {
662 if providerCfg.Type == anthropic.Name && c.isAnthropicThinking(model) {