parseMaxAICreditsValue parses max-ai-credits from either integer or numeric-string frontmatter values. A return value of 0 is a sentinel that means "not configured" (missing or invalid); explicit zero is not a valid user value. Negative values (-1) are passed through as-is and signal that budget en
(raw any)
| 16 | // passed through as-is and signal that budget enforcement and token steering |
| 17 | // should be disabled. |
| 18 | func parseMaxAICreditsValue(raw any) int64 { |
| 19 | if parsed, ok := parseMaxEffectiveTokenLimitValue(raw); ok { |
| 20 | return parsed |
| 21 | } |
| 22 | if raw != nil { |
| 23 | engineLog.Printf("Ignoring invalid max-ai-credits value of type %T: %v", raw, raw) |
| 24 | } |
| 25 | return 0 |
| 26 | } |
| 27 | |
| 28 | // parseMaxRunsValue parses max-runs from either integer or numeric-string |
| 29 | // frontmatter values. |
no test coverage detected