Status 获取 Agent 状态
(agentID string)
| 90 | |
| 91 | // Status 获取 Agent 状态 |
| 92 | func (p *Pool) Status(agentID string) (*types.AgentStatus, error) { |
| 93 | p.mu.RLock() |
| 94 | ag, exists := p.agents[agentID] |
| 95 | p.mu.RUnlock() |
| 96 | |
| 97 | if !exists { |
| 98 | return nil, fmt.Errorf("agent not found: %s", agentID) |
| 99 | } |
| 100 | |
| 101 | return ag.Status(), nil |
| 102 | } |
| 103 | |
| 104 | // Resume 从存储中恢复 Agent |
| 105 | func (p *Pool) Resume(ctx context.Context, agentID string, config *types.AgentConfig) (*agent.Agent, error) { |
no outgoing calls