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)
| 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. |
| 118 | func 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 |
| 129 | func (c *Compiler) validateMaxTurnsSupport(frontmatter map[string]any, engine CodingAgentEngine) error { |
no test coverage detected