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

Method warnUnrecognizedModelParams

pkg/workflow/model_alias_validation.go:211–228  ·  view source on GitHub ↗

─── V-MAF-011: unknown parameter warning ───────────────────────────────────── warnUnrecognizedModelParams emits a compiler warning for each unrecognised parameter key found in the given model identifier strings (V-MAF-011).

(identifiers []string, markdownPath string)

Source from the content-addressed store, hash-verified

209// warnUnrecognizedModelParams emits a compiler warning for each unrecognised
210// parameter key found in the given model identifier strings (V-MAF-011).
211func (c *Compiler) warnUnrecognizedModelParams(identifiers []string, markdownPath string) {
212 for _, id := range identifiers {
213 if id == "" || containsExpression(id) {
214 continue
215 }
216 p, err := ParseModelIdentifier(id)
217 if err != nil {
218 continue // syntax errors are reported elsewhere
219 }
220 for _, k := range UnrecognizedParams(p.Params) {
221 msg := fmt.Sprintf("models: unrecognised parameter key %q in %q — "+
222 "known parameters are: effort, temperature (V-MAF-011)", k, id)
223 fmt.Fprintln(os.Stderr, console.FormatWarningMessage(
224 formatCompilerMessage(markdownPath, "warning", msg)))
225 c.IncrementWarningCount()
226 }
227 }
228}
229
230// ─── V-MAF-010: circular alias detection ─────────────────────────────────────
231

Calls 6

IncrementWarningCountMethod · 0.95
FormatWarningMessageFunction · 0.92
containsExpressionFunction · 0.85
ParseModelIdentifierFunction · 0.85
UnrecognizedParamsFunction · 0.85
formatCompilerMessageFunction · 0.85