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:
parent
748ac58dd1
commit
36b9693d31
1 changed files with 1 additions and 1 deletions
|
|
@ -342,7 +342,7 @@ func (t *CronTool) ExecuteJob(ctx context.Context, job *cron.CronJob) string {
|
||||||
return "ok"
|
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
|
// Call agent with the job message
|
||||||
response, err := t.executor.ProcessDirectWithChannel(
|
response, err := t.executor.ProcessDirectWithChannel(
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue