Skip to content

Commit 3c3683e

Browse files
committed
Restore custom python session types
1 parent 44f23b6 commit 3c3683e

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

python/copilot/generated/session_events.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,14 @@ class SessionEventType(Enum):
692692
TOOL_EXECUTION_START = "tool.execution_start"
693693
TOOL_USER_REQUESTED = "tool.user_requested"
694694
USER_MESSAGE = "user.message"
695+
# UNKNOWN is used for forward compatibility - new event types from the server
696+
# will map to this value instead of raising an error
697+
UNKNOWN = "unknown"
698+
699+
@classmethod
700+
def _missing_(cls, value: object) -> "SessionEventType":
701+
"""Handle unknown event types gracefully for forward compatibility."""
702+
return cls.UNKNOWN
695703

696704

697705
@dataclass

0 commit comments

Comments
 (0)