(raw any)
| 56 | } |
| 57 | |
| 58 | func parseMaxTurnsValue(raw any) string { |
| 59 | if val, ok := typeutil.ParseIntValue(raw); ok && val > 0 { |
| 60 | return strconv.Itoa(val) |
| 61 | } |
| 62 | if rawStr, ok := raw.(string); ok { |
| 63 | trimmed := strings.TrimSpace(rawStr) |
| 64 | if trimmed == "" { |
| 65 | return "" |
| 66 | } |
| 67 | if parsed, err := strconv.Atoi(trimmed); err == nil && parsed > 0 { |
| 68 | return strconv.Itoa(parsed) |
| 69 | } |
| 70 | // Match the same GitHub Actions expression wrapper accepted by the schema. |
| 71 | // The schema and GitHub Actions runtime are responsible for validating the |
| 72 | // expression body itself; this helper only needs to preserve templated values. |
| 73 | if strings.HasPrefix(trimmed, "${{") && strings.HasSuffix(trimmed, "}}") { |
| 74 | return trimmed |
| 75 | } |
| 76 | engineLog.Printf("Ignoring invalid max-turns value: %q", rawStr) |
| 77 | } |
| 78 | return "" |
| 79 | } |
| 80 | |
| 81 | func parseMaxToolDenialsValue(raw any) string { |
| 82 | if val, ok := typeutil.ParseIntValue(raw); ok && val > 0 { |
no test coverage detected