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

Function validateTaskMaxAttempts

internal/task/validate.go:1296–1307  ·  view source on GitHub ↗
(maxAttempts int, path string, allowZeroDefault bool)

Source from the content-addressed store, hash-verified

1294}
1295
1296func validateTaskMaxAttempts(maxAttempts int, path string, allowZeroDefault bool) error {
1297 if allowZeroDefault && maxAttempts == 0 {
1298 return nil
1299 }
1300 if maxAttempts <= 0 {
1301 return fmt.Errorf("%w: %s must be positive: %d", ErrValidation, path, maxAttempts)
1302 }
1303 if maxAttempts > MaxTaskMaxAttempts {
1304 return fmt.Errorf("%w: %s must be <= %d: %d", ErrValidation, path, MaxTaskMaxAttempts, maxAttempts)
1305 }
1306 return nil
1307}
1308
1309func normalizeApprovalPolicyOrDefault(policy ApprovalPolicy) ApprovalPolicy {
1310 normalized := policy.Normalize()

Callers 3

ValidateMethod · 0.85
ValidateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected