MCPcopy Index your code
hub / github.com/github/copilot-sdk / _register_hooks

Method _register_hooks

python/copilot/session.py:2602–2617  ·  view source on GitHub ↗

Register hook handlers for session lifecycle events. Hooks allow custom logic to be executed at various points during the session lifecycle (before/after tool use, session start/end, etc.). Note: This method is internal. Hooks are typically registered

(self, hooks: SessionHooks | None)

Source from the content-addressed store, hash-verified

2600 self._transform_callbacks = callbacks
2601
2602 def _register_hooks(self, hooks: SessionHooks | None) -> None:
2603 """
2604 Register hook handlers for session lifecycle events.
2605
2606 Hooks allow custom logic to be executed at various points during
2607 the session lifecycle (before/after tool use, session start/end, etc.).
2608
2609 Note:
2610 This method is internal. Hooks are typically registered
2611 when creating a session via :meth:`CopilotClient.create_session`.
2612
2613 Args:
2614 hooks: The hooks configuration object, or None to remove all hooks.
2615 """
2616 with self._hooks_lock:
2617 self._hooks = hooks
2618
2619 async def _handle_system_message_transform(
2620 self, sections: dict[str, dict[str, str]]

Callers 2

_initialize_sessionMethod · 0.95
resume_sessionMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected