Fix ImportError: SessionEventType not exported from copilot public API (#1093)

* Initial plan

* Fix ImportError: remove SessionEventType from copilot imports, use string comparisons

Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/awesome-copilot/sessions/0c514b95-5157-4aa9-8590-cbf3fd337472

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
This commit is contained in:
Copilot
2026-03-20 10:51:21 +11:00
committed by GitHub
parent 07e1e665d6
commit 6fbbc5204e
6 changed files with 19 additions and 19 deletions

View File

@@ -7,7 +7,7 @@ import os
import re
from copilot import (
CopilotClient, SessionConfig, MessageOptions,
SessionEvent, SessionEventType,
SessionEvent,
)
# ============================================================================
@@ -119,9 +119,9 @@ The current working directory is: {os.getcwd()}
# Set up event handling
def handle_event(event: SessionEvent):
if event.type == SessionEventType.ASSISTANT_MESSAGE:
if event.type.value == "assistant.message":
print(f"\n🤖 {event.data.content}\n")
elif event.type == SessionEventType.TOOL_EXECUTION_START:
elif event.type.value == "tool.execution_start":
print(f" ⚙️ {event.data.tool_name}")
elif event.type.value == "session.idle":
done.set()