Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions amplifier_module_provider_github_copilot/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,19 @@ async def create_session(
session_config["hooks"] = hooks
logger.debug(f"[CLIENT] Session hooks configured: {list(hooks.keys())}")

# Add permission handler required by SDK >= 0.1.28
# See: github/copilot-sdk#509, #554 - deny all permissions by default
try:
from copilot.types import PermissionHandler

# SDK >= 0.1.28 has PermissionHandler.approve_all
# SDK < 0.1.28 has PermissionHandler as a type alias (no approve_all)
session_config["on_permission_request"] = PermissionHandler.approve_all
logger.debug("[CLIENT] Permission handler set to approve_all")
except (ImportError, AttributeError):
# Older SDK versions don't require this or don't have approve_all
pass

# Session creation - separated from yield to avoid exception masking
try:
logger.debug(
Expand Down