mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-17 23:57:30 +08:00
fix bug
This commit is contained in:
@@ -591,15 +591,8 @@ func (al *AgentLoop) maybeRunAutonomyRound(msg bus.InboundMessage) bool {
|
|||||||
s.lastNudgeAt = now
|
s.lastNudgeAt = now
|
||||||
s.pending = true
|
s.pending = true
|
||||||
focus := strings.TrimSpace(s.focus)
|
focus := strings.TrimSpace(s.focus)
|
||||||
idleFor := now.Sub(s.lastUserAt).Truncate(time.Second)
|
|
||||||
al.autonomyMu.Unlock()
|
al.autonomyMu.Unlock()
|
||||||
|
|
||||||
al.bus.PublishOutbound(bus.OutboundMessage{
|
|
||||||
Channel: msg.Channel,
|
|
||||||
ChatID: msg.ChatID,
|
|
||||||
Content: fmt.Sprintf("[自主模式] 你已空闲 %s,我已启动第 %d 轮自主推进。", idleFor, round),
|
|
||||||
})
|
|
||||||
|
|
||||||
al.bus.PublishInbound(bus.InboundMessage{
|
al.bus.PublishInbound(bus.InboundMessage{
|
||||||
Channel: msg.Channel,
|
Channel: msg.Channel,
|
||||||
SenderID: "autonomy",
|
SenderID: "autonomy",
|
||||||
@@ -893,18 +886,22 @@ func (al *AgentLoop) processMessage(ctx context.Context, msg bus.InboundMessage)
|
|||||||
}
|
}
|
||||||
|
|
||||||
directives := parseTaskExecutionDirectives(msg.Content)
|
directives := parseTaskExecutionDirectives(msg.Content)
|
||||||
if inferred, ok := al.inferTaskExecutionDirectives(ctx, msg.Content); ok {
|
if controlEligible {
|
||||||
// Explicit /run/@run command always has higher priority than inferred directives.
|
if inferred, ok := al.inferTaskExecutionDirectives(ctx, msg.Content); ok {
|
||||||
if !isExplicitRunCommand(msg.Content) {
|
// Explicit /run/@run command always has higher priority than inferred directives.
|
||||||
directives = inferred
|
if !isExplicitRunCommand(msg.Content) {
|
||||||
|
directives = inferred
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// Synthetic messages should run quietly and only report final outcomes.
|
||||||
|
directives.stageReport = false
|
||||||
}
|
}
|
||||||
userPrompt := directives.task
|
userPrompt := directives.task
|
||||||
if strings.TrimSpace(userPrompt) == "" {
|
if strings.TrimSpace(userPrompt) == "" {
|
||||||
userPrompt = msg.Content
|
userPrompt = msg.Content
|
||||||
}
|
}
|
||||||
if al.isAutonomyEnabled(msg.SessionKey) && controlEligible {
|
if al.isAutonomyEnabled(msg.SessionKey) && controlEligible {
|
||||||
directives.stageReport = true
|
|
||||||
userPrompt = buildAutonomyTaskPrompt(userPrompt)
|
userPrompt = buildAutonomyTaskPrompt(userPrompt)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user