fix: resolver system_prompt_file relativo al directorio del config

Antes, el runtime construia la ruta del system prompt como
agents/<agent-id>/<file>, lo cual fallaba para agentes en
agents/_specials/ (como Father Bot). Ahora:

1. config.Load() guarda el directorio del config en ConfigDir
2. llm.go usa ConfigDir para resolver rutas relativas

Esto corrige que Father Bot operara sin su system prompt completo
(369 lineas de instrucciones, pipeline, seguridad) usando solo la
description de una linea como fallback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-10 23:21:23 +00:00
parent bbfbcf4f16
commit 1b499c9b67
3 changed files with 10 additions and 2 deletions
+2 -2
View File
@@ -29,8 +29,8 @@ func (a *Agent) runLLM(ctx context.Context, msgCtx decision.MessageContext, memK
// Load system prompt from file if configured, else use description
systemPrompt := a.cfg.Agent.Description
if spFile := a.cfg.LLM.Reasoning.SystemPromptFile; spFile != "" {
// Resolve path relative to agent directory
spPath := filepath.Join("agents", a.cfg.Agent.ID, spFile)
// Resolve path relative to the config directory (handles _specials/ and custom locations)
spPath := filepath.Join(a.cfg.ConfigDir, spFile)
if data, err := os.ReadFile(spPath); err == nil {
systemPrompt = string(data)
} else {