X-Git-Url: http://git.giacomolli.uk/onechat/blobdiff_plain/ddd0a50f7b801112376d7fb27bfd05d2fc26c2fd..087d725b5ab41ad34ffd24938482d45a8b99a080:/agent.go?ds=sidebyside diff --git a/agent.go b/agent.go index 1be2b0a..3fc9546 100644 --- a/agent.go +++ b/agent.go @@ -87,10 +87,15 @@ func (a *Agent) CacheKey() string { func (a *Agent) Prompt() (string, error) { instructions, err := a.instructions() if err != nil { - return "", err + return "", fmt.Errorf("read prompt instructions: %w", err) + } + + 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, instructions), nil + return prompt(a.config.Name, path, instructions), nil } // SubagentPrompt returns the system prompt of a subagent of the agent, with the