{"record":{"id":"30280ec9457d4ea7","repo":"agentscope-ai/agentscope","slug":"unknown-permission-mode-mode","errorCode":null,"errorMessage":"Unknown permission mode: {mode}","messagePattern":"Unknown permission mode: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/agentscope/permission/_engine.py","lineNumber":115,"sourceCode":"                The tool input data, used for rule matching and\n                tool-specific checks.\n\n        Returns:\n            `PermissionDecision`:\n                Decision indicating whether to allow, deny, or ask.\n        \"\"\"\n        mode = self.context.mode\n        if mode == PermissionMode.DEFAULT:\n            return await self._check_default(tool, tool_input)\n        if mode == PermissionMode.EXPLORE:\n            return await self._check_explore(tool, tool_input)\n        if mode == PermissionMode.ACCEPT_EDITS:\n            return await self._check_accept_edits(tool, tool_input)\n        if mode == PermissionMode.BYPASS:\n            return await self._check_bypass(tool, tool_input)\n        if mode == PermissionMode.DONT_ASK:\n            return await self._check_dont_ask(tool, tool_input)\n        raise ValueError(f\"Unknown permission mode: {mode}\")\n\n    async def _check_default(\n        self,\n        tool: ToolBase,\n        tool_input: dict[str, Any],\n    ) -> PermissionDecision:\n        \"\"\"Permission check for :attr:`PermissionMode.DEFAULT`.\n\n        Every operation requires explicit permission unless it is a\n        read-only invocation, an allow rule matches, or the tool's own\n        ``check_permissions`` returns ALLOW. Evaluation order:\n\n        1. Deny rules → DENY\n        2. Ask rules → ASK (with suggestions)\n        3. Read-only fast path → ALLOW\n        4. ``tool.check_permissions``:\n            - ALLOW / DENY → returned as-is\n            - Safety ASK (bypass-immune) → returned with suggestions; cannot","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/agentscope-ai/agentscope/blob/e90f1c7592896cc95f6e5ee506194f533378247d/src/agentscope/permission/_engine.py#L97-L133","documentation":"The permission engine dispatched on PermissionMode but found a value matching none of ACCEPT_EDITS, BYPASS, DONT_ASK (or DEFAULT handled earlier). This indicates an unknown/invalid permission mode string reached check_permission.","triggerScenarios":"Setting agent permission mode to a typo like 'accept_edit', 'auto', 'always', or passing a raw string not in the PermissionMode enum.","commonSituations":"Passing mode from a CLI/config with the wrong name; version change renaming modes; constructing PermissionConfig manually with arbitrary strings.","solutions":["Use one of the documented PermissionMode values, ideally the enum: PermissionMode.DEFAULT / ACCEPT_EDITS / BYPASS / DONT_ASK","Check the exact spelling/casing expected by your agentscope version (see PermissionMode enum source)","Validate config values against PermissionMode at load time"],"exampleFix":"# before\nagent = ReActAgent(..., permission={'mode': 'accept_edit'})\n\n# after\nfrom agentscope.permission import PermissionMode\nagent = ReActAgent(..., permission={'mode': PermissionMode.ACCEPT_EDITS})","handlingStrategy":"validation","validationCode":"from agentscope.permission import PermissionMode\nassert mode in PermissionMode, f'unknown permission mode: {mode}'","typeGuard":"from agentscope.permission import PermissionMode\n\ndef is_permission_mode(m) -> bool:\n    return m in PermissionMode","tryCatchPattern":null,"preventionTips":["Always use the PermissionMode enum instead of raw strings","Validate config values at app startup"],"tags":["agentscope","permission","enum","config"],"backgroundTag":"invalid-enum-value","analyzedSha":"e90f1c7592896cc95f6e5ee506194f533378247d","analyzedAt":"2026-08-28T18:24:12.087Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}