feat(#1466): add sessions table + turn_stats.session_id capture for per-session stats

This commit is contained in:
damocles 2026-06-10 19:37:48 +02:00 committed by mara
commit 17ddba0341
5 changed files with 102 additions and 3 deletions

View file

@ -652,6 +652,10 @@ async fn run_claude(prompt: &str, files: &TurnFiles, bus: &Bus) -> Result<(bool,
let effort = bus.effort();
let resume = !bus.take_skip_continue();
if !resume {
// Flag the fresh session so the bin loop mints a new `sessions`
// row + stamps its id onto this turn's stats (and subsequent
// turns until the next fresh start).
bus.mark_fresh_session();
bus.emit(LiveEvent::Note {
text: "fresh session (--continue suppressed for this turn)".into(),
});