MCPcopy Create free account
hub / github.com/compozy/agh / stopTerminalRunSession

Method stopTerminalRunSession

internal/task/manager.go:3528–3543  ·  view source on GitHub ↗
(ctx context.Context, run Run, reason StopReason)

Source from the content-addressed store, hash-verified

3526}
3527
3528func (m *Service) stopTerminalRunSession(ctx context.Context, run Run, reason StopReason) error {
3529 sessionID := strings.TrimSpace(run.SessionID)
3530 if sessionID == "" {
3531 return nil
3532 }
3533 if err := m.requireSessionExecutor("stop terminal run session"); err != nil {
3534 return err
3535 }
3536 if err := m.sessions.RequestTaskStop(ctx, sessionID, reason); err != nil {
3537 return fmt.Errorf("task: request stop for session %q: %w", sessionID, err)
3538 }
3539 if err := m.waitAndForceStopRun(ctx, sessionID, reason); err != nil {
3540 return err
3541 }
3542 return nil
3543}
3544
3545func (m *Service) stopRecoveredRunSession(ctx context.Context, run Run, recovery RunBootRecovery) error {
3546 sessionID := strings.TrimSpace(run.SessionID)

Callers 3

CompleteRunMethod · 0.95

Calls 3

waitAndForceStopRunMethod · 0.95
RequestTaskStopMethod · 0.65

Tested by

no test coverage detected