fix(agent): broadcast task updates to agents on global env changes and use constant for task_env

This commit is contained in:
duorameng
2026-06-08 20:18:11 +08:00
parent 56587cacda
commit 073916b97a
3 changed files with 26 additions and 2 deletions
+14
View File
@@ -230,6 +230,20 @@ func (m *AgentWSManager) BroadcastTasks(agentID string) {
})
}
// BroadcastTasksToAll 广播任务更新给所有在线 Agent
func (m *AgentWSManager) BroadcastTasksToAll() {
m.mu.RLock()
var agentIDs []string
for agentID := range m.connections {
agentIDs = append(agentIDs, agentID)
}
m.mu.RUnlock()
for _, agentID := range agentIDs {
m.BroadcastTasks(agentID)
}
}
// RegisterRemoteWaiter 注册远程任务结果等待者
func (m *AgentWSManager) RegisterRemoteWaiter(logID string) chan *models.AgentTaskResult {
m.mu.Lock()