{"record":{"id":"b0d8f49770a72db2","repo":"HKUDS/DeepTutor","slug":"unknown-capability-requested-available-avai","errorCode":null,"errorMessage":"Unknown capability `{requested}`. Available: {available}","messagePattern":"Unknown capability `(.+?)`\\. Available: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"deeptutor/app/facade.py","lineNumber":75,"sourceCode":"    \"\"\"Facade around runtime, session, notebook, and capability contracts.\"\"\"\n\n    def __init__(self) -> None:\n        self.runtime = get_turn_runtime_manager()\n        self.store = get_session_store()\n        self.notebooks = get_notebook_manager()\n        self.capabilities = get_capability_registry()\n\n    def resolve_capability(self, value: str | None) -> str:\n        requested = str(value or \"chat\").strip() or \"chat\"\n        manifests = self.capabilities.get_manifests()\n        for manifest in manifests:\n            if manifest[\"name\"] == requested:\n                return requested\n            aliases = {str(alias).strip() for alias in manifest.get(\"cli_aliases\", [])}\n            if requested in aliases:\n                return str(manifest[\"name\"])\n        available = \", \".join(sorted(manifest[\"name\"] for manifest in manifests))\n        raise ValueError(f\"Unknown capability `{requested}`. Available: {available}\")\n\n    def get_capability_contracts(self) -> list[dict[str, Any]]:\n        contracts = []\n        for manifest in self.capabilities.get_manifests():\n            contracts.append(\n                {\n                    **manifest,\n                    \"availability\": self.get_capability_availability(manifest[\"name\"]).__dict__,\n                }\n            )\n        return contracts\n\n    def get_capability_contract(self, value: str) -> dict[str, Any]:\n        resolved = self.resolve_capability(value)\n        for manifest in self.capabilities.get_manifests():\n            if manifest[\"name\"] == resolved:\n                return {\n                    **manifest,","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/app/facade.py#L57-L93","documentation":"ChatOrchestrator's facade could not resolve the requested capability name against the registered capability manifests. It matches against each manifest's canonical `name` and its `cli_aliases`; a miss raises ValueError listing every registered capability.","triggerScenarios":"Calling `app.resolve_capability(name)` (directly or via `get_capability_contract`, `get_capability_availability`, `start_turn`) with a string that is neither a registered manifest name nor one of its `cli_aliases` — e.g. typos ('deepsovle'), removed/renamed capabilities, or a plugin whose registration failed at startup.","commonSituations":"Upgrading DeepTutor after a capability was renamed; using a stale capability name from old docs; a custom capability plugin failing to register so its name never appears in the registry; passing 'guided-learning' when only the alias table maps some names.","solutions":["Check the error's 'Available:' list and use one of those exact names","Use `app.get_capability_contracts()` to enumerate valid names and aliases programmatically","If the capability should exist, verify the plugin/entry point registered correctly at bootstrap","For custom capabilities, confirm the manifest's `name` field and `cli_aliases` spelling"],"exampleFix":"// before\ncontract = app.get_capability_contract(\"deep_solve_v2\")\n\n// after\ncontract = app.get_capability_contract(\"deep_solve\")  # canonical name from Available: list","handlingStrategy":"validation","validationCode":"valid = {m[\"name\"] for m in app.get_capability_contracts()} |\n       {a for m in app.get_capability_contracts() for a in m.get(\"cli_aliases\", [])}\nif requested not in valid:\n    raise SystemExit(f\"unknown capability {requested!r}; choose from {sorted(valid)}\")","typeGuard":"def is_known_capability(app, name: str) -> bool:\n    contracts = app.get_capability_contracts()\n    return any(\n        c[\"name\"] == name or name in c.get(\"cli_aliases\", []) for c in contracts\n    )","tryCatchPattern":"try:\n    resolved = app.resolve_capability(name)\nexcept ValueError as exc:\n    # message already lists available capabilities\n    print(exc); sys.exit(2)","preventionTips":["Derive capability names from get_capability_contracts() instead of hardcoding","Validate user-supplied capability strings before start_turn","Re-check valid names after upgrading DeepTutor"],"tags":["capability","registry","validation","deeptutor"],"backgroundTag":"unknown-capability-name","analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}