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

Function requireRunTransition

internal/task/manager.go:3588–3601  ·  view source on GitHub ↗
(run Run, next RunStatus)

Source from the content-addressed store, hash-verified

3586}
3587
3588func requireRunTransition(run Run, next RunStatus) error {
3589 current := run.Status.Normalize()
3590 target := next.Normalize()
3591 if allowsRunTransition(current, target) {
3592 return nil
3593 }
3594 return fmt.Errorf(
3595 "%w: task run %q cannot transition from %q to %q",
3596 ErrInvalidStatusTransition,
3597 run.ID,
3598 current,
3599 target,
3600 )
3601}
3602
3603func allowsRunTransition(current RunStatus, next RunStatus) bool {
3604 switch current.Normalize() {

Callers 5

ClaimRunMethod · 0.85
StartRunMethod · 0.85
CompleteRunMethod · 0.85
cancelRunRecordMethod · 0.85

Calls 2

allowsRunTransitionFunction · 0.85
NormalizeMethod · 0.45

Tested by

no test coverage detected