X-Git-Url: http://git.giacomolli.uk/onechat/blobdiff_plain/d302957c09b192d0fbc09287ba7dcb7c32426556..0bc8db71aa5d2c55b215a7a15b073bb85a1172eb:/agent.go?ds=inline diff --git a/agent.go b/agent.go index 1d76c5b..0d97cdf 100644 --- a/agent.go +++ b/agent.go @@ -50,6 +50,7 @@ func openAgent(dir string) (*Agent, error) { decoder := json.NewDecoder(bytes.NewReader(data)) decoder.DisallowUnknownFields() + err = decoder.Decode(&config) if err == nil && !errors.Is(decoder.Decode(&struct{}{}), io.EOF) { err = errors.New("data after the JSON object") @@ -87,7 +88,7 @@ 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))