Skip to content

Commit b24b24a

Browse files
jmoseleyCopilot
andcommitted
Fix Python shell handler exports and logging
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 9704437 commit b24b24a

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

python/copilot/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@
3939
SessionEvent,
4040
SessionListFilter,
4141
SessionMetadata,
42+
ShellExitHandler,
4243
ShellExitNotification,
44+
ShellOutputHandler,
4345
ShellOutputNotification,
46+
ShellOutputStream,
4447
StopError,
4548
SubprocessConfig,
4649
SystemMessageAppendConfig,
@@ -90,8 +93,11 @@
9093
"SessionEvent",
9194
"SessionListFilter",
9295
"SessionMetadata",
96+
"ShellExitHandler",
9397
"ShellExitNotification",
98+
"ShellOutputHandler",
9499
"ShellOutputNotification",
100+
"ShellOutputStream",
95101
"StopError",
96102
"SYSTEM_PROMPT_SECTIONS",
97103
"SubprocessConfig",

python/copilot/session.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,8 @@ def _dispatch_shell_output(self, notification: ShellOutputNotification) -> None:
343343
for handler in handlers:
344344
try:
345345
handler(notification)
346-
except Exception:
347-
pass # Ignore handler errors
346+
except Exception as e:
347+
print(f"Error in shell output handler: {e}")
348348

349349
def _dispatch_shell_exit(self, notification: ShellExitNotification) -> None:
350350
"""Dispatch a shell exit notification to all registered handlers."""
@@ -354,8 +354,8 @@ def _dispatch_shell_exit(self, notification: ShellExitNotification) -> None:
354354
for handler in handlers:
355355
try:
356356
handler(notification)
357-
except Exception:
358-
pass # Ignore handler errors
357+
except Exception as e:
358+
print(f"Error in shell exit handler: {e}")
359359

360360
def _track_shell_process(self, process_id: str) -> None:
361361
"""Track a shell process ID so notifications are routed to this session."""

0 commit comments

Comments
 (0)