| 1171 | }) |
| 1172 | |
| 1173 | def on_thinking_chunk(chunk: str) -> None: |
| 1174 | # Live reasoning deltas → a separate thinking delta the TUI renders |
| 1175 | # in its streaming thinking view (the original's live thinking, §3). |
| 1176 | self._emit({ |
| 1177 | "type": "stream_event", |
| 1178 | "session_id": self.session_id, |
| 1179 | "event": { |
| 1180 | "type": "content_block_delta", |
| 1181 | "delta": {"type": "thinking_delta", "thinking": chunk}, |
| 1182 | }, |
| 1183 | }) |
| 1184 | |
| 1185 | def on_message(message: Any) -> None: |
| 1186 | # Persist into the session conversation so the next turn pairs |