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

Function parseMaxAICreditsValue

pkg/workflow/engine_config_parser.go:18–26  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

16// passed through as-is and signal that budget enforcement and token steering
17// should be disabled.
18func 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.

Callers 3

ExtractEngineConfigMethod · 0.85

Calls 2

PrintfMethod · 0.45

Tested by

no test coverage detected