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

Method controlRunningTool

pkg/agent/agent.go:1402–1422  ·  view source on GitHub ↗
(callID, action string)

Source from the content-addressed store, hash-verified

1400}
1401
1402func (a *Agent) controlRunningTool(callID, action string) error {
1403 a.mu.RLock()
1404 handle, ok := a.runningTools[callID]
1405 a.mu.RUnlock()
1406
1407 if !ok || handle == nil || handle.interruptible == nil {
1408 return errors.New("tool not interruptible or not running")
1409 }
1410
1411 switch action {
1412 case "pause":
1413 return handle.interruptible.Pause()
1414 case "resume":
1415 return handle.interruptible.Resume()
1416 case "cancel":
1417 a.updateToolRecord(callID, types.ToolCallStateCancelling, "")
1418 return handle.interruptible.Cancel()
1419 default:
1420 return fmt.Errorf("unknown action: %s", action)
1421 }
1422}
1423
1424func (a *Agent) snapshotToolCall(callID string) types.ToolCallSnapshot {
1425 a.mu.RLock()

Callers 1

ControlToolMethod · 0.95

Calls 4

updateToolRecordMethod · 0.95
PauseMethod · 0.65
ResumeMethod · 0.65
CancelMethod · 0.65

Tested by

no test coverage detected