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

Method validateBareModeSupport

pkg/workflow/agent_validation.go:236–251  ·  view source on GitHub ↗

validateBareModeSupport validates that bare mode is only used with engines that support this feature. Emits a warning and has no effect on engines that do not support bare mode.

(frontmatter map[string]any, engine CodingAgentEngine)

Source from the content-addressed store, hash-verified

234// validateBareModeSupport validates that bare mode is only used with engines that support this feature.
235// Emits a warning and has no effect on engines that do not support bare mode.
236func (c *Compiler) validateBareModeSupport(frontmatter map[string]any, engine CodingAgentEngine) {
237 _, engineConfig := c.ExtractEngineConfig(frontmatter)
238
239 if engineConfig == nil || !engineConfig.Bare {
240 // bare mode not requested, no validation needed
241 return
242 }
243
244 agentValidationLog.Printf("Validating bare mode support for engine: %s", engine.GetID())
245
246 if !engine.GetCapabilities().BareMode {
247 agentValidationLog.Printf("Engine %s does not support bare mode, emitting warning", engine.GetID())
248 fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf("Engine '%s' does not support bare mode (engine.bare: true). Bare mode is only supported for the 'copilot' and 'claude' engines. The setting will be ignored.", engine.GetID())))
249 c.IncrementWarningCount()
250 }
251}
252
253// validateWorkflowRunBranches validates workflow_run trigger requirements.
254// It enforces required workflows and branch restrictions guidance.

Callers 1

Calls 6

ExtractEngineConfigMethod · 0.95
IncrementWarningCountMethod · 0.95
FormatWarningMessageFunction · 0.92
GetIDMethod · 0.65
GetCapabilitiesMethod · 0.65
PrintfMethod · 0.45

Tested by

no test coverage detected