Skip to content

docs: update session persistence docs for read-consistency fix#457

Open
MervinPraison wants to merge 1 commit into
mainfrom
claude/issue-449-20260530-0622
Open

docs: update session persistence docs for read-consistency fix#457
MervinPraison wants to merge 1 commit into
mainfrom
claude/issue-449-20260530-0622

Conversation

@MervinPraison
Copy link
Copy Markdown
Owner

Summary

Updates session persistence documentation to reflect the read-consistency fixes from PraisonAI PR #1759.

Changes Made:

  • session-persistence.mdx: Extended Multi-Process Safety section to document that reads are now also disk-consistent, added sequence diagram showing fresh read behavior
  • persistence-json.mdx: Added note about read paths acquiring file locks and reloading from disk on every call
  • session-protocol.mdx: Added tip for custom stores about reading fresh from backing store on every call

Background

PraisonAI PR #1759 fixed a read-staleness bug in DefaultSessionStore where reads could return stale cached data when multiple store instances shared the same session_dir. The fix makes all read operations (get_chat_history, get_session, get_sessions_by_agent) reload from disk under FileLock on every call.

This ensures that multiple processes sharing a session directory always see each other's latest writes, eliminating the stale-cache window that could cause LLMs to receive truncated chat context.

Fixes #449

🤖 Generated with Claude Code

…449)

- Update Multi-Process Safety section in session-persistence.mdx to document fresh reads
- Add read-consistency note in persistence-json.mdx about file lock acquisition on reads
- Add tip in session-protocol.mdx about custom stores reading fresh from backing store
- Include sequence diagram showing read consistency between two store instances

This reflects the behavior changes from PraisonAI PR #1759 which fixed read-staleness
in DefaultSessionStore by making reads always disk-consistent.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <MervinPraison@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 30, 2026 06:24
@qodo-code-review
Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 30, 2026

Warning

Review limit reached

@MervinPraison, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 41 minutes and 30 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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9d199fb0-211d-48cc-8459-96bead45a71c

📥 Commits

Reviewing files that changed from the base of the PR and between ad3daba and b536f1b.

📒 Files selected for processing (3)
  • docs/features/persistence-json.mdx
  • docs/features/session-persistence.mdx
  • docs/features/session-protocol.mdx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/issue-449-20260530-0622

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the documentation to clarify that the session store uses file locking for both reads and writes to prevent in-memory cache staleness across multiple processes. Feedback on the changes points out that a newly added tip in the session protocol documentation incorrectly mentions get_session as part of the SessionStoreProtocol, which could mislead developers implementing custom stores.

</Tip>

<Tip>
If your custom store backs onto shared storage (Redis, Postgres, S3, another file system), make `get_chat_history` and `get_session` read from that backing store on every call rather than caching in process memory. `DefaultSessionStore` guarantees this; downstream code (e.g. `BotSessionManager._load_history`) relies on it.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The tip mentions get_session, but get_session is not part of the SessionStoreProtocol (which only requires add_message, get_chat_history, clear_session, delete_session, and session_exists). Furthermore, downstream code like BotSessionManager._load_history only calls get_chat_history and does not rely on get_session. Mentioning get_session here is misleading for developers implementing custom stores.

Suggested Change

Update the tip to only refer to get_chat_history:

If your custom store backs onto shared storage (Redis, Postgres, S3, another file system), make `get_chat_history` read from that backing store on every call rather than caching in process memory. `DefaultSessionStore` guarantees this; downstream code (e.g. `BotSessionManager._load_history`) relies on it.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: update session persistence docs for read-consistency fix (PraisonAI #1759)

2 participants