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

Method validateMaxTurnsSupport

pkg/workflow/agent_validation.go:129–139  ·  view source on GitHub ↗

validateMaxTurnsSupport validates that max-turns is only used with engines that support this feature

(frontmatter map[string]any, engine CodingAgentEngine)

Source from the content-addressed store, hash-verified

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 {
130 // Check if max-turns is specified in the engine config
131 _, engineConfig := c.ExtractEngineConfig(frontmatter)
132
133 hasMaxTurns := engineConfig != nil && engineConfig.MaxTurns != ""
134
135 if hasMaxTurns {
136 agentValidationLog.Printf("Validating max-turns support: engine=%s", engine.GetID())
137 }
138 return validateCapabilitySupport("max-turns", hasMaxTurns, engine.GetCapabilities().MaxTurns, engine.GetID())
139}
140
141// validateMaxContinuationsSupport validates that max-continuations is only used with engines that support this feature
142func (c *Compiler) validateMaxContinuationsSupport(frontmatter map[string]any, engine CodingAgentEngine) error {

Callers 1

Calls 5

ExtractEngineConfigMethod · 0.95
GetIDMethod · 0.65
GetCapabilitiesMethod · 0.65
PrintfMethod · 0.45

Tested by

no test coverage detected