{"record":{"id":"db2e917aff629d34","repo":"HKUDS/nanobot","slug":"model-preset-name-r-not-found-available","errorCode":null,"errorMessage":"model_preset {name!r} not found. Available: {', '.join(presets) or '(none)'}","messagePattern":"model_preset (.+?) not found\\. Available: (.+?)","errorType":"validation","errorClass":"KeyError","httpStatus":null,"severity":"error","filePath":"nanobot/agent/model_presets.py","lineNumber":87,"sourceCode":"    presets: dict[str, ModelPresetConfig],\n    provider: LLMProvider,\n    loader: PresetSnapshotLoader | None,\n) -> ProviderSnapshot:\n    if loader is not None:\n        return replace(loader(name), model_preset=name)\n    return build_static_preset_snapshot(provider, name, presets[name])\n\n\ndef normalize_preset_name(name: str | None, presets: dict[str, ModelPresetConfig]) -> str:\n    if not isinstance(name, str) or not name.strip():\n        raise ValueError(\"model_preset must be a non-empty string\")\n    name = name.strip()\n    if name in presets:\n        return name\n    matches = [candidate for candidate in presets if candidate.casefold() == name.casefold()]\n    if len(matches) == 1:\n        return matches[0]\n    raise KeyError(f\"model_preset {name!r} not found. Available: {', '.join(presets) or '(none)'}\")\n","sourceCodeStart":69,"sourceCodeEnd":88,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/agent/model_presets.py#L69-L88","documentation":"Raised by normalize_preset_name when the stripped preset name does not exactly match any key in the presets dict (fuzzy matching against available keys is attempted first but found no candidate). The message lists the actually available preset names so callers can self-correct; '(none)' appears when no presets are configured at all.","triggerScenarios":"Thrown at nanobot/agent/model_presets.py:87 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use one of the preset names listed in the error message","Check for typos or case differences in the preset name","Add the missing preset under model_presets in the configuration"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"42f37dc4c0e409eac7818a82d165c5f2757bc075","analyzedAt":"2026-08-26T00:18:52.276Z","contentChangedAt":"2026-08-26T00:18:52.276Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}