MCPcopy Create free account
hub / github.com/github/gh-aw / parseMaxRunsValue

Function parseMaxRunsValue

pkg/workflow/engine_config_parser.go:30–41  ·  view source on GitHub ↗

parseMaxRunsValue parses max-runs from either integer or numeric-string frontmatter values.

(raw any)

Source from the content-addressed store, hash-verified

28// parseMaxRunsValue parses max-runs from either integer or numeric-string
29// frontmatter values.
30func parseMaxRunsValue(raw any) int {
31 if val, ok := typeutil.ParseIntValue(raw); ok && val > 0 {
32 return val
33 }
34 if rawStr, ok := raw.(string); ok {
35 if parsed, err := strconv.Atoi(rawStr); err == nil && parsed > 0 {
36 return parsed
37 }
38 engineLog.Printf("Ignoring invalid max-runs value: %q", rawStr)
39 }
40 return 0
41}
42
43// parseMaxTurnCacheMissesValue parses max-turn-cache-misses from either integer or
44// numeric-string frontmatter values.

Callers 2

ExtractEngineConfigMethod · 0.85

Calls 2

ParseIntValueFunction · 0.92
PrintfMethod · 0.45

Tested by

no test coverage detected