Register a handler for permission requests. When the assistant needs permission to perform certain actions (e.g., file operations), this handler is called to approve or deny the request. Note: This method is internal. Permission handlers are typically r
(self, handler: _PermissionHandlerFn | None)
| 2417 | return self._tool_handlers.get(name) |
| 2418 | |
| 2419 | def _register_permission_handler(self, handler: _PermissionHandlerFn | None) -> None: |
| 2420 | """ |
| 2421 | Register a handler for permission requests. |
| 2422 | |
| 2423 | When the assistant needs permission to perform certain actions (e.g., |
| 2424 | file operations), this handler is called to approve or deny the request. |
| 2425 | |
| 2426 | Note: |
| 2427 | This method is internal. Permission handlers are typically registered |
| 2428 | when creating a session via :meth:`CopilotClient.create_session`. |
| 2429 | |
| 2430 | Args: |
| 2431 | handler: The permission handler function, or None to remove the handler. |
| 2432 | """ |
| 2433 | with self._permission_handler_lock: |
| 2434 | self._permission_handler = handler |
| 2435 | |
| 2436 | async def _handle_permission_request( |
| 2437 | self, request: PermissionRequest |
no outgoing calls
no test coverage detected