Extract a `Session` struct to hold state about a given thread's scripting session (#26282)

We're still recreating a session for every tool call, but the idea is to
have a long-lived `Session` per assistant thread.

Release Notes:

- N/A

---------

Co-authored-by: Agus Zubiaga <hi@aguz.me>
efde5aa2bbAntonio Scandurra committed on 3/7/2025, 3:44:36 PM· committed by GitHubparentfcc5e27
4 files changedLine totals unavailable