parseMaxTurnCacheMissesValue parses max-turn-cache-misses from either integer or numeric-string frontmatter values.
(raw any)
| 43 | // parseMaxTurnCacheMissesValue parses max-turn-cache-misses from either integer or |
| 44 | // numeric-string frontmatter values. |
| 45 | func 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 | |
| 58 | func parseMaxTurnsValue(raw any) string { |
| 59 | if val, ok := typeutil.ParseIntValue(raw); ok && val > 0 { |
no test coverage detected