validateWebSearchSupport validates that web-search tool is only used with engines that support this feature
(tools map[string]any, engine CodingAgentEngine)
| 213 | |
| 214 | // validateWebSearchSupport validates that web-search tool is only used with engines that support this feature |
| 215 | func (c *Compiler) validateWebSearchSupport(tools map[string]any, engine CodingAgentEngine) { |
| 216 | // Check if web-search tool is requested |
| 217 | _, hasWebSearch := tools["web-search"] |
| 218 | |
| 219 | if !hasWebSearch { |
| 220 | // No web-search specified, no validation needed |
| 221 | return |
| 222 | } |
| 223 | |
| 224 | agentValidationLog.Printf("Validating web-search support for engine: %s", engine.GetID()) |
| 225 | |
| 226 | // web-search is specified, check if the engine supports it |
| 227 | if !engine.GetCapabilities().WebSearch { |
| 228 | agentValidationLog.Printf("Engine %s does not natively support web-search tool, emitting warning", engine.GetID()) |
| 229 | fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf("Engine '%s' does not support the web-search tool. See https://github.github.com/gh-aw/guides/web-search/ for alternatives.", engine.GetID()))) |
| 230 | c.IncrementWarningCount() |
| 231 | } |
| 232 | } |
| 233 | |
| 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. |
no test coverage detected