public withCompactionObserver(observer as LLMCompactionObserver) as LLMChatSession
Attaches an observer notified before the context compactor starts. A LLMCompactionLifecycleObserver also receives completion and failure.
UI implementations should enqueue events because compaction runs from the request worker thread.
session.withCompactionObserver(observer)