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")
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))