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

Function parseMaxToolDenialsValue

pkg/workflow/engine_config_parser.go:81–99  ·  view source on GitHub ↗
(raw any)

Source from the content-addressed store, hash-verified

79}
80
81func parseMaxToolDenialsValue(raw any) string {
82 if val, ok := typeutil.ParseIntValue(raw); ok && val > 0 {
83 return strconv.Itoa(val)
84 }
85 if rawStr, ok := raw.(string); ok {
86 trimmed := strings.TrimSpace(rawStr)
87 if trimmed == "" {
88 return ""
89 }
90 if parsed, err := strconv.Atoi(trimmed); err == nil && parsed > 0 {
91 return strconv.Itoa(parsed)
92 }
93 if strings.HasPrefix(trimmed, "${{") && strings.HasSuffix(trimmed, "}}") {
94 return trimmed
95 }
96 engineLog.Printf("Ignoring invalid max-tool-denials value: %q", rawStr)
97 }
98 return ""
99}
100
101// parseAuthDefinition converts a raw auth config map (from engine.provider.auth) into
102// an AuthDefinition. It is backward-compatible: a map with only a "secret" key produces

Callers 2

ExtractEngineConfigMethod · 0.85

Calls 2

ParseIntValueFunction · 0.92
PrintfMethod · 0.45

Tested by

no test coverage detected