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

Function parseMaxTurnCacheMissesValue

pkg/workflow/engine_config_parser.go:45–56  ·  view source on GitHub ↗

parseMaxTurnCacheMissesValue parses max-turn-cache-misses from either integer or numeric-string frontmatter values.

(raw any)

Source from the content-addressed store, hash-verified

43// parseMaxTurnCacheMissesValue parses max-turn-cache-misses from either integer or
44// numeric-string frontmatter values.
45func parseMaxTurnCacheMissesValue(raw any) int {
46 if val, ok := typeutil.ParseIntValue(raw); ok && val > 0 {
47 return val
48 }
49 if rawStr, ok := raw.(string); ok {
50 if parsed, err := strconv.Atoi(rawStr); err == nil && parsed > 0 {
51 return parsed
52 }
53 engineLog.Printf("Ignoring invalid max-turn-cache-misses value: %q", rawStr)
54 }
55 return 0
56}
57
58func parseMaxTurnsValue(raw any) string {
59 if val, ok := typeutil.ParseIntValue(raw); ok && val > 0 {

Callers 2

ExtractEngineConfigMethod · 0.85

Calls 2

ParseIntValueFunction · 0.92
PrintfMethod · 0.45

Tested by

no test coverage detected