返回 DeepSeek-Reasonix
config_field_source.go
根目录 / internal / config / config_field_source.go
1 package config
2
3 import "strings"
4
5 // ConfigFileDefinesCompactRatio reports whether path explicitly overrides the
6 // automatic compaction threshold. It is used by config surfaces that need to
7 // explain whether the effective value came from defaults, user config, or the
8 // current project.
9 func ConfigFileDefinesCompactRatio(path string) bool {
10 return tomlFileDefinesKey(path, "agent", "compact_ratio")
11 }
12
13 // ConfigFileDefinesSkillKey reports whether a project or user TOML file
14 // explicitly owns one of the supported [skills] settings. Desktop settings use
15 // this narrow provenance check to edit the file that wins at runtime instead
16 // of persisting a shadowed value to the global config.
17 func ConfigFileDefinesSkillKey(path, key string) bool {
18 switch strings.TrimSpace(key) {
19 case "paths", "excluded_paths", "disabled_skills", "disable_implicit_invocation", "max_depth":
20 return tomlFileDefinesKey(path, "skills", key)
21 default:
22 return false
23 }
24 }
25
26 // ConfigFileDefinesWebSearchModel reports an explicit project assignment override.
27 func ConfigFileDefinesWebSearchModel(path string) bool {
28 return tomlFileDefinesKey(path, "agent", "web_search_model")
29 }
30
30 lines GO