MCPcopy Create free account
hub / github.com/astercloud/aster / Remove

Method Remove

pkg/core/pool.go:140–157  ·  view source on GitHub ↗

Remove 从池中移除 Agent (不删除存储)

(agentID string)

Source from the content-addressed store, hash-verified

138
139// Remove 从池中移除 Agent (不删除存储)
140func (p *Pool) Remove(agentID string) error {
141 p.mu.Lock()
142 defer p.mu.Unlock()
143
144 ag, exists := p.agents[agentID]
145 if !exists {
146 return fmt.Errorf("agent not found: %s", agentID)
147 }
148
149 // 关闭 Agent
150 if err := ag.Close(); err != nil {
151 return fmt.Errorf("close agent: %w", err)
152 }
153
154 // 从池中移除
155 delete(p.agents, agentID)
156 return nil
157}
158
159// Delete 删除 Agent (包括存储)
160func (p *Pool) Delete(ctx context.Context, agentID string) error {

Callers 15

TestPool_RemoveFunction · 0.95
getFromFileMethod · 0.45
deleteFromFileMethod · 0.45
cleanupFilesMethod · 0.45
ExecuteMethod · 0.45
ExecuteMethod · 0.45
ExecuteMethod · 0.45
CleanupSubagentMethod · 0.45
DeleteDataMethod · 0.45
DeleteMethod · 0.45
CleanupTaskMethod · 0.45
cleanupCompletedTasksMethod · 0.45

Calls 2

deleteFunction · 0.85
CloseMethod · 0.65

Tested by 3

TestPool_RemoveFunction · 0.76
SetupTestMethod · 0.36