fix: add Message field to session.Entry and check marshal error

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Mathias Bergqvist
2026-04-17 20:43:01 +02:00
parent 9cfce8f700
commit a2889645fc
2 changed files with 6 additions and 1 deletions

View File

@@ -45,10 +45,14 @@ func (s *Skill) Handle(ctx context.Context, tool string, args json.RawMessage) (
FilePath: a.FilePath,
ModelUsed: a.ModelUsed,
DurationMs: a.DurationMs,
Message: a.Message,
}
if err := session.Append(s.cfg.SessionsDir, a.SessionID, entry); err != nil {
return nil, fmt.Errorf("append session log: %w", err)
}
b, _ := json.Marshal(map[string]string{"status": "ok", "session_id": a.SessionID})
b, err := json.Marshal(map[string]string{"status": "ok", "session_id": a.SessionID})
if err != nil {
return nil, fmt.Errorf("marshal response: %w", err)
}
return b, nil
}