fix(ci): satisfy golines and gosmopolitan in cron code

This commit is contained in:
ShenQingchuan 2026-03-29 13:30:59 +08:00
parent 5d803d3b54
commit d40957974c
2 changed files with 5 additions and 2 deletions

View file

@ -393,7 +393,10 @@ func (t *CronTool) ExecuteJob(ctx context.Context, job *cron.CronJob) string {
prompt := job.Payload.Message prompt := job.Payload.Message
if isDirective { if isDirective {
// For directive type, prefix to clarify this is an instruction // For directive type, prefix to clarify this is an instruction
prompt = fmt.Sprintf("Please execute the following directive and provide the result:\n\n%s", job.Payload.Message) prompt = fmt.Sprintf(
"Please execute the following directive and provide the result:\n\n%s",
job.Payload.Message,
)
} }
// Call agent with the prepared prompt // Call agent with the prepared prompt

View file

@ -329,7 +329,7 @@ func TestCronTool_ExecuteJobSkipsEmptyAgentResponse(t *testing.T) {
} }
func TestCronTool_ExecuteJobSkipsWhenMessageToolAlreadySent(t *testing.T) { func TestCronTool_ExecuteJobSkipsWhenMessageToolAlreadySent(t *testing.T) {
executor := &stubJobExecutor{response: "已发送。", alreadySent: true} executor := &stubJobExecutor{response: "Sent.", alreadySent: true}
tool := newTestCronToolWithExecutorAndConfig(t, executor, config.DefaultConfig()) tool := newTestCronToolWithExecutorAndConfig(t, executor, config.DefaultConfig())
job := &cron.CronJob{ID: "job-msg-sent"} job := &cron.CronJob{ID: "job-msg-sent"}