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

Function validateCapabilitySupport

pkg/workflow/agent_validation.go:118–126  ·  view source on GitHub ↗

validateCapabilitySupport is a shared helper that checks whether an engine supports a required capability. It returns an error with a standard "not supported" message when the feature is requested but the engine capability is missing. Returns nil when featureSet is false (feature not requested) or w

(featureName string, featureSet bool, capabilitySupported bool, engineID string)

Source from the content-addressed store, hash-verified

116// the feature is requested but the engine capability is missing.
117// Returns nil when featureSet is false (feature not requested) or when the engine supports it.
118func validateCapabilitySupport(featureName string, featureSet bool, capabilitySupported bool, engineID string) error {
119 if !featureSet {
120 return nil
121 }
122 if !capabilitySupported {
123 return fmt.Errorf("%s not supported: engine '%s' does not support the %s feature", featureName, engineID, featureName)
124 }
125 return nil
126}
127
128// validateMaxTurnsSupport validates that max-turns is only used with engines that support this feature
129func (c *Compiler) validateMaxTurnsSupport(frontmatter map[string]any, engine CodingAgentEngine) error {

Callers 2

Calls 1

ErrorfMethod · 0.45

Tested by

no test coverage detected