]> git.giacomolli.uk - onechat/blobdiff - agent.go
Let the agent keep user instructions
[onechat] / agent.go
index 1be2b0a136f54dbfa55573ce4b37e572f9798191..1d76c5b943b495f7b36e0599b4b3be8f51af32d1 100644 (file)
--- a/agent.go
+++ b/agent.go
@@ -90,7 +90,12 @@ func (a *Agent) Prompt() (string, error) {
                return "", err
        }
 
-       return prompt(a.config.Name, instructions), nil
+       path, err := filepath.Abs(filepath.Join(a.dir, agentInstructionsFileName))
+       if err != nil {
+               return "", fmt.Errorf("find instructions path: %w", err)
+       }
+
+       return prompt(a.config.Name, path, instructions), nil
 }
 
 // SubagentPrompt returns the system prompt of a subagent of the agent, with the