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 parent
748ac58dd1
commit
36b9693d31
1 file changed
+1
-1
+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