@@ -61,7 +61,7 @@ type EmbeddingConfig struct {
6161type DefaultsConfig struct {
6262 SimilarityThreshold float64 `yaml:"similarity_threshold"`
6363 MaxSimilarToShow int `yaml:"max_similar_to_show"`
64- CrossRepoSearch bool `yaml:"cross_repo_search"`
64+ CrossRepoSearch * bool `yaml:"cross_repo_search,omitempty "`
6565}
6666
6767// RepositoryConfig defines a repository and its settings.
@@ -88,9 +88,9 @@ type TransferRule struct {
8888
8989// TransferConfig holds transfer routing settings.
9090type TransferConfig struct {
91- Enabled bool `yaml:"enabled"`
91+ Enabled * bool `yaml:"enabled,omitempty "`
9292 Rules []TransferRule `yaml:"rules,omitempty"`
93- LLMRoutingEnabled bool `yaml:"llm_routing_enabled,omitempty"`
93+ LLMRoutingEnabled * bool `yaml:"llm_routing_enabled,omitempty"`
9494 HighConfidence float64 `yaml:"high_confidence,omitempty"` // Default: 0.9
9595 MediumConfidence float64 `yaml:"medium_confidence,omitempty"` // Default: 0.6
9696 DuplicateConfidenceThreshold float64 `yaml:"duplicate_confidence_threshold,omitempty"` // Default: 0.8
@@ -183,13 +183,25 @@ func (c *Config) applyDefaults() {
183183 if c .Defaults .MaxSimilarToShow == 0 {
184184 c .Defaults .MaxSimilarToShow = 5
185185 }
186+ if c .Defaults .CrossRepoSearch == nil {
187+ f := false
188+ c .Defaults .CrossRepoSearch = & f
189+ }
186190 if c .Embedding .Provider == "" {
187191 c .Embedding .Provider = "gemini"
188192 }
189193 if c .Embedding .Dimensions == 0 {
190194 c .Embedding .Dimensions = 768
191195 }
192- // Transfer LLM routing defaults
196+ // Transfer defaults
197+ if c .Transfer .Enabled == nil {
198+ f := false
199+ c .Transfer .Enabled = & f
200+ }
201+ if c .Transfer .LLMRoutingEnabled == nil {
202+ f := false
203+ c .Transfer .LLMRoutingEnabled = & f
204+ }
193205 if c .Transfer .HighConfidence == 0 {
194206 c .Transfer .HighConfidence = 0.9
195207 }
@@ -243,18 +255,22 @@ func mergeConfigs(parent, child *Config) *Config {
243255 if child .Defaults .MaxSimilarToShow != 0 {
244256 result .Defaults .MaxSimilarToShow = child .Defaults .MaxSimilarToShow
245257 }
246- // CrossRepoSearch: always take the child value so it can override parent true -> false and vice versa
247- result .Defaults .CrossRepoSearch = child .Defaults .CrossRepoSearch
258+ if child .Defaults .CrossRepoSearch != nil {
259+ result .Defaults .CrossRepoSearch = child .Defaults .CrossRepoSearch
260+ }
248261
249262 // Repositories: child completely overrides if non-empty
250263 if len (child .Repositories ) > 0 {
251264 result .Repositories = child .Repositories
252265 }
253266
254- // Transfer.Enabled: always take the child value so it can override parent true -> false and vice versa
255- result .Transfer .Enabled = child .Transfer .Enabled
256- result .Transfer .LLMRoutingEnabled = child .Transfer .LLMRoutingEnabled
257- // Transfer.Rules: child overrides rules if non-empty; otherwise inherit from parent
267+ // Transfer: override if fields are set
268+ if child .Transfer .Enabled != nil {
269+ result .Transfer .Enabled = child .Transfer .Enabled
270+ }
271+ if child .Transfer .LLMRoutingEnabled != nil {
272+ result .Transfer .LLMRoutingEnabled = child .Transfer .LLMRoutingEnabled
273+ }
258274 if len (child .Transfer .Rules ) > 0 {
259275 result .Transfer .Rules = child .Transfer .Rules
260276 }
0 commit comments