fix: resolveDataBase usa ConfigDir como fallback para data path
Cuando no se configura storage.base_path ni AGENTS_DATA_DIR, el fallback anterior hardcodeaba "agents/<id>/data" asumiendo que el binario se ejecuta desde la raiz del repo. Ahora se usa cfg.ConfigDir (directorio del config.yaml) como base, lo que funciona correctamente para agentes en _specials/ y cualquier ubicacion arbitraria del config. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -295,7 +295,7 @@ func buildToolRegistry(
|
||||
}
|
||||
|
||||
// resolveDataBase returns the base directory for agent runtime data.
|
||||
// Priority: config storage.base_path > $AGENTS_DATA_DIR/<id> > agents/<id>/data
|
||||
// Priority: config storage.base_path > $AGENTS_DATA_DIR/<id> > <config-dir>/data
|
||||
func resolveDataBase(cfg *config.AgentConfig) string {
|
||||
if cfg.Storage.BasePath != "" {
|
||||
return cfg.Storage.BasePath
|
||||
@@ -303,5 +303,8 @@ func resolveDataBase(cfg *config.AgentConfig) string {
|
||||
if envDir := os.Getenv("AGENTS_DATA_DIR"); envDir != "" {
|
||||
return filepath.Join(envDir, cfg.Agent.ID)
|
||||
}
|
||||
if cfg.ConfigDir != "" {
|
||||
return filepath.Join(cfg.ConfigDir, "data")
|
||||
}
|
||||
return filepath.Join("agents", cfg.Agent.ID, "data")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user