{"record":{"id":"7db03dcbfd65b037","repo":"HKUDS/nanobot","slug":"webhook-path-must-start-with","errorCode":null,"errorMessage":"webhook_path must start with \"/\"","messagePattern":"webhook_path must start with \"/\"","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"nanobot/channels/telegram/runtime.py","lineNumber":435,"sourceCode":"    streaming: bool = True\n    # Enable inline keyboard buttons in Telegram messages.\n    inline_keyboards: bool = False\n    # Opt in to Bot API 10.1 sendRichMessage for richer markdown rendering.\n    rich_messages: bool = False\n    stream_edit_interval: float = Field(default=_STREAM_EDIT_INTERVAL_DEFAULT, ge=0.1)\n    webhook_url: str = \"\"\n    webhook_listen_host: str = \"127.0.0.1\"\n    webhook_listen_port: int = Field(default=8081, ge=1, le=65535)\n    webhook_path: str = \"/telegram\"\n    webhook_secret_token: str = \"\"\n    webhook_max_connections: int = Field(default=4, ge=1, le=100)\n\n    @field_validator(\"webhook_path\")\n    @classmethod\n    def webhook_path_must_start_with_slash(cls, value: str) -> str:\n        value = value.strip() or \"/telegram\"\n        if not value.startswith(\"/\"):\n            raise ValueError('webhook_path must start with \"/\"')\n        return value\n\n    @model_validator(mode=\"after\")\n    def validate_webhook_config(self) -> \"TelegramConfig\":\n        if self.mode != \"webhook\":\n            return self\n\n        url = self.webhook_url.strip()\n        if not url:\n            raise ValueError(\"webhook_url is required when Telegram mode is webhook\")\n        parsed = urlparse(url)\n        if parsed.scheme != \"https\" or not parsed.netloc:\n            raise ValueError(\"webhook_url must be a public HTTPS URL\")\n        secret = self.webhook_secret_token.strip()\n        if not secret:\n            raise ValueError(\"webhook_secret_token is required when Telegram mode is webhook\")\n        if len(secret) > 256 or re.match(r\"^[A-Za-z0-9_-]+$\", secret) is None:\n            raise ValueError(","sourceCodeStart":417,"sourceCodeEnd":453,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/channels/telegram/runtime.py#L417-L453","documentation":"Error \"webhook_path must start with \"/\"\" thrown in HKUDS/nanobot.","triggerScenarios":"Thrown at nanobot/channels/telegram/runtime.py:435 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"42f37dc4c0e409eac7818a82d165c5f2757bc075","analyzedAt":"2026-08-26T00:18:52.276Z","schemaVersion":2},"datasetVersion":"2026-08-26T04:18:47.238Z"}