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

Method stopRecoveredRunSession

internal/task/manager.go:3545–3560  ·  view source on GitHub ↗
(ctx context.Context, run Run, recovery RunBootRecovery)

Source from the content-addressed store, hash-verified

3543}
3544
3545func (m *Service) stopRecoveredRunSession(ctx context.Context, run Run, recovery RunBootRecovery) error {
3546 sessionID := strings.TrimSpace(run.SessionID)
3547 if sessionID == "" {
3548 return nil
3549 }
3550 if err := m.requireSessionExecutor("stop recovered run session"); err != nil {
3551 return err
3552 }
3553 if recoverySessionStateRequiresCooperativeStop(recovery.SessionState) {
3554 return m.stopTerminalRunSession(ctx, run, StopReasonFailed)
3555 }
3556 if err := m.sessions.ForceTaskStop(ctx, sessionID, StopReasonFailed); err != nil {
3557 return fmt.Errorf("task: force stop session %q: %w", sessionID, err)
3558 }
3559 return nil
3560}
3561
3562func (m *Service) waitAndForceStopRun(ctx context.Context, sessionID string, reason StopReason) error {
3563 if m.cancelGracePeriod > 0 {

Callers 1

recoverRunByFailureMethod · 0.95

Tested by

no test coverage detected