mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
fix(cron): make each job execution use an independent session
Previously all executions of the same cron job reused the session key
"cron-{jobID}", causing conversation history to accumulate across runs.
Now each run gets a unique key "cron-{jobID}-{timestamp}", preventing
cross-execution interference.
This commit is contained in:
+1
-1
@@ -342,7 +342,7 @@ func (t *CronTool) ExecuteJob(ctx context.Context, job *cron.CronJob) string {
|
||||
return "ok"
|
||||
}
|
||||
|
||||
sessionKey := fmt.Sprintf("cron-%s", job.ID)
|
||||
sessionKey := fmt.Sprintf("cron-%s-%d", job.ID, time.Now().UnixMilli())
|
||||
|
||||
// Call agent with the job message
|
||||
response, err := t.executor.ProcessDirectWithChannel(
|
||||
|
||||
Reference in New Issue
Block a user