- Fix ruff error: consolidate contextlib imports into single from-import
- Fix test patch targets: middleware tests must patch middleware module
after imports were promoted to module level (not auth module)
- Fix _tool_allowed_for_current_user: pass public tools through when
user resolution fails (only hide tools with _class_permission_name)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>