docs: update session persistence + managed stream docs for PR #1768#475
Conversation
…streaming history, set_chat_history, atomic bot writes) - Add set_chat_history() to session-management.mdx Direct Session Store Access accordion - Add streaming persistence note to managed-agents-local.mdx Session Management section - Add Concurrent Writes section to session-resume.mdx explaining atomic session handling - Update bot-os.mdx Memory capability description with multi-worker safety note These changes document the session message loss fixes and atomic history management improvements from MervinPraison/PraisonAI#1768. 🤖 Generated with Claude Code (https://claude.ai/code) Co-Authored-By: Mervin Praison <MervinPraison@users.noreply.github.com>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Warning Review limit reached
More reviews will be available in 52 minutes and 24 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request updates the documentation to explain session persistence, concurrent writes, and atomic batch replacement features across several markdown files. However, the documentation references a set_chat_history method on DefaultSessionStore that does not exist in the codebase, which would result in an AttributeError if used.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| store.set_chat_history( | ||
| "session-123", | ||
| [ | ||
| {"role": "user", "content": "Hello"}, | ||
| {"role": "assistant", "content": "Hi there!"}, | ||
| ], | ||
| ) |
There was a problem hiding this comment.
The documented method set_chat_history does not exist in the DefaultSessionStore class in praisonaiagents/session/store.py. Attempting to call this method will result in an AttributeError. Please ensure that the set_chat_history method is implemented in DefaultSessionStore before documenting it, or update the documentation to use existing APIs.
There was a problem hiding this comment.
Pull request overview
Updates PraisonAI Docs to reflect recent session persistence improvements (atomic history replacement and streaming-path persistence) and to clarify multi-worker/concurrent-write behavior for session resume and bots.
Changes:
- Added a new “Concurrent Writes” section to the Session Resume docs describing atomic history update behavior.
- Documented the new
set_chat_history()API as an atomic batch-replace option in session management docs. - Added notes clarifying streaming session persistence for local managed agents and multi-worker safety messaging for bot memory.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| docs/persistence/session-resume.mdx | Adds guidance about concurrent writes/session safety during updates. |
| docs/concepts/session-management.mdx | Documents set_chat_history() with an atomic batch replace example. |
| docs/concepts/managed-agents-local.mdx | Adds a note clarifying that streaming and non-streaming paths persist history/usage. |
| docs/concepts/bot-os.mdx | Updates the “Memory” capability description to mention concurrent-update safety. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| ## Concurrent Writes | ||
|
|
||
| Multiple bot workers writing to the same `session_id` are safe — history saves use a single locked atomic write under the hood, so no worker sees an empty history mid-update. |
| Multiple bot workers writing to the same `session_id` are safe — history saves use a single locked atomic write under the hood, so no worker sees an empty history mid-update. | ||
|
|
||
| This applies to: | ||
| - Messaging bots (`praisonai bot telegram`, `discord`, `slack`, `whatsapp`) |
| - Multi-process deployments resuming the same session key | ||
| - Managed agents streaming chunks back to the user | ||
|
|
||
| You do not need to add a custom lock around `agent.start()`. |
| | Capability | CLI Flag | What It Does | | ||
| |-----------|---------|-------------| | ||
| | **Memory** | `--memory` | Remembers what users said in previous messages | | ||
| | **Memory** | `--memory` | Remembers what users said in previous messages. Safe for multi-worker deployments — messages survive concurrent updates | |
| <Note> | ||
| Both `agent.start(..., stream=True)` and the non-streaming path persist the user prompt, the full assistant response, and token usage to the session store. Resume the session later and the full history is available — streaming does not drop messages. | ||
| </Note> |
| | Capability | CLI Flag | What It Does | | ||
| |-----------|---------|-------------| | ||
| | **Memory** | `--memory` | Remembers what users said in previous messages | | ||
| | **Memory** | `--memory` | Remembers what users said in previous messages. Safe for multi-worker deployments — messages survive concurrent updates | |
Fixes #472
Summary
Updates documentation for session persistence and managed stream improvements from MervinPraison/PraisonAI#1768 (merged 2026-06-02): "fix: session message loss in managed stream and bot history saves".
Changes Made
1. docs/concepts/session-management.mdx
2. docs/concepts/managed-agents-local.mdx
3. docs/persistence/session-resume.mdx
4. docs/concepts/bot-os.mdx
Verification
API Details Confirmed
🤖 Generated with Claude Code