mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-18 21:30:48 +08:00
refactor: stabilize runtime and unify config
This commit is contained in:
@@ -440,7 +440,7 @@ func GetConfigDir() string {
|
||||
|
||||
func DefaultConfig() *Config {
|
||||
configDir := GetConfigDir()
|
||||
return &Config{
|
||||
cfg := &Config{
|
||||
Agents: AgentsConfig{
|
||||
Defaults: AgentDefaults{
|
||||
Workspace: filepath.Join(configDir, "workspace"),
|
||||
@@ -657,6 +657,8 @@ func DefaultConfig() *Config {
|
||||
},
|
||||
},
|
||||
}
|
||||
cfg.Normalize()
|
||||
return cfg
|
||||
}
|
||||
|
||||
func normalizeProviderNameAlias(name string) string {
|
||||
@@ -767,6 +769,7 @@ func LoadConfig(path string) (*Config, error) {
|
||||
if err := env.Parse(cfg); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cfg.Normalize()
|
||||
|
||||
return cfg, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user