filename:
automation/after_dinner.go
branch:
main
back to repo
package automation
import (
"context"
"strings"
"time"
"assistant/agent"
"assistant/config"
"assistant/util"
)
func runAfterDinnerRecap(ctx context.Context, cfg *config.Config, ag *agent.Agent, tel *agent.Telemetry) {
if ag == nil {
return
}
var b strings.Builder
b.WriteString("Produce an after-dinner recap for today. ")
b.WriteString("Review what is new from today's session context and any relevant memory items. ")
b.WriteString("Summarize key wins, risks, and unfinished items in concise bullets. ")
if cfg.Tools.Memory.Enabled {
b.WriteString("If memory tools are available, use them to ground what changed and what should be remembered. ")
}
b.WriteString("End by asking the user what to keep an eye on tomorrow and what should be saved to long-term memory for future reference. ")
b.WriteString("Keep it under about 350 words.")
reply, err := ag.Run(ctx, b.String())
if err != nil {
util.Logf("after dinner recap failed: %v", err)
if tel != nil {
tel.SetAutomationLast("after_dinner_recap", time.Now(), false, err.Error())
}
return
}
util.Logf("after dinner recap:\n%s", reply)
if tel != nil {
tel.SetAutomationLast("after_dinner_recap", time.Now(), true, "")
}
}