[Feature Request] Store session data at creation time to allow continuation after failure
Problem Description
Currently, session data is only stored when a run completes successfully. If an error occurs during agent execution, the session is lost, making it impossible to resume or debug from the point of failure. This results in:
Frustrating user experience (conversation lost on error).
Limited debugging visibility for incomplete runs.
Inability to resume from partial state.
Proposed Solution
Persist session data as it is created, regardless of whether the agent run succeeds or fails.
Ensure that a session object is created at the start of execution.
Incrementally persist session state (stream of events, steps, or messages).
On error, session remains available for inspection or continuation.
Implementation approaches:
Offload persistence work to a background worker (e.g., Taskiq or Celery) to avoid performance bottlenecks.
Use background tasks pulling from an in-memory stream to asynchronously write session updates.
Alternatives Considered
No response
Additional Context
No response
Would you like to work on this?
- [ ] Yes, I’d love to work on it!
- [ ] I’m open to collaborating but need guidance.
- [ ] No, I’m just sharing the idea.
@monali7-d I can work on this issue. Can I get it assigned as part of Hacktober fest 2025?
@monali7-d Hey! I'd like to work on this issue for Hacktoberfest. Please assign it to me if it's available.
This issue has been automatically marked as stale due to 30 days of inactivity.