OnRunStart persists the session row before the run loop starts. Sub-sessions skip this: the parent session's store absorbs them via the SubSessionCompletedEvent handling in OnEvent.
(ctx context.Context, sess *session.Session)
| 58 | // Sub-sessions skip this: the parent session's store absorbs them via |
| 59 | // the SubSessionCompletedEvent handling in OnEvent. |
| 60 | func (p *PersistenceObserver) OnRunStart(ctx context.Context, sess *session.Session) { |
| 61 | if sess.IsSubSession() { |
| 62 | return |
| 63 | } |
| 64 | if err := p.store.UpdateSession(ctx, sess); err != nil { |
| 65 | slog.WarnContext(ctx, "Failed to persist initial session", "session_id", sess.ID, "error", err) |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | // OnEvent applies the per-event-type persistence rules. Sub-session |
| 70 | // events are skipped (the parent absorbs them on SubSessionCompleted), |
nothing calls this directly
no test coverage detected