You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR MervinPraison/PraisonAI#1544 was merged today. It makes the DefaultSessionStore file-locking mechanism cross-platform compatible, fixing a Windows test collection failure caused by an unconditional import fcntl in praisonaiagents/session/store.py.
Commit head SHA: 09f7f4e5f58a432cfbdf48750c8e0fb6131e5e67
This is purely a bug fix (no new APIs, no parameter changes), but it carries a user-facing guarantee that the docs do not currently surface: DefaultSessionStore works on both Unix and Windows out of the box, with multi-process-safe file locking on each platform.
Decision: Update Existing Content (No New Page Needed)
Question
Answer
New API surface?
No
New configuration option?
No
New user-facing feature?
No (the locking behaviour was always intended; PR just makes it actually work on Windows)
Existing page covers this area?
Yes — docs/features/persistence-json.mdx
New page required?
No
Update required?
Yes — add a Cross-Platform Support section to the existing page
This is an update, not a new page. The new docs agent should editdocs/features/persistence-json.mdx (and optionally add a one-liner to docs/features/persistence.mdx).
What Changed in the SDK (Source of Truth)
File:praisonaiagents/session/store.py
Before:
importfcntl# Unconditional — crashes on Windows during import
After:
importsys# fcntl is Unix-only; on Windows, use msvcrt for file lockingifsys.platform!='win32':
importfcntl_HAS_FCNTL=Trueelse:
_HAS_FCNTL=False
The FileLock class inside DefaultSessionStore already had a sys.platform == "win32" branch using msvcrt.locking(...). The PR just makes the fcntl import itself conditional so the module can be imported at all on Windows.
If neither fcntl nor msvcrt is available (theoretical edge case), acquire() logs a one-time warning and continues without locking:
"File locking unavailable on this platform (no fcntl/msvcrt); concurrent writers may corrupt session files."
Required Documentation Update
File to update
docs/features/persistence-json.mdx
Where to insert
After the existing "How It Works" section, add a new section titled "Cross-Platform Support" before "Configuration Options".
---## Cross-Platform SupportJSON persistence works the same on macOS, Linux, and Windows — no extra configuration.```mermaidgraph LR subgraph "Cross-Platform File Locking" A[🧠 Agent] --> B{🖥️ Platform?} B -->|macOS / Linux| C[🔒 fcntl lock] B -->|Windows| D[🔒 msvcrt lock] C --> E[💾 Safe Write] D --> E end classDef agent fill:#8B0000,stroke:#7C90A0,color:#fff classDef detect fill:#F59E0B,stroke:#7C90A0,color:#fff classDef lock fill:#189AB4,stroke:#7C90A0,color:#fff classDef write fill:#10B981,stroke:#7C90A0,color:#fff class A agent class B detect class C,D lock class E write```The same agent code runs everywhere:
```pythonfrom praisonaiagents import Agentagent = Agent( name="FileBot", instructions="You are a helpful assistant.", session_id="cross-platform-session")agent.chat("Hello! Works on macOS, Linux, and Windows.")```| Platform | File Lock Mechanism | Multi-Process Safe ||----------|---------------------|--------------------|| macOS | `fcntl.flock` | ✅ Yes || Linux | `fcntl.flock` | ✅ Yes || Windows | `msvcrt.locking` | ✅ Yes |<Note>If you run multiple agent processes that share the same `session_dir`, thestore automatically prevents concurrent writers from corrupting sessionfiles — on every supported OS.</Note>
Optional: Tiny note on docs/features/persistence.mdx
In the existing "Storage Backend Options" card grid, the JSON Files card description can be tightened to reassure Windows users:
"Simple file-based storage with cross-platform locking — works on macOS, Linux, and Windows."
(Pure copy change; no structural edits.)
Folder Placement (per AGENTS.md §1.8)
✅ Update docs/features/persistence-json.mdx
✅ (Optional) Touch docs/features/persistence.mdx
❌ Do NOT create or modify anything in docs/concepts/
❌ Do NOT modify docs/js/ or docs/rust/ (auto-generated)
Context
PR MervinPraison/PraisonAI#1544 was merged today. It makes the
DefaultSessionStorefile-locking mechanism cross-platform compatible, fixing a Windows test collection failure caused by an unconditionalimport fcntlinpraisonaiagents/session/store.py.praisonaiagents/session/store.py09f7f4e5f58a432cfbdf48750c8e0fb6131e5e67This is purely a bug fix (no new APIs, no parameter changes), but it carries a user-facing guarantee that the docs do not currently surface:
DefaultSessionStoreworks on both Unix and Windows out of the box, with multi-process-safe file locking on each platform.Decision: Update Existing Content (No New Page Needed)
docs/features/persistence-json.mdxWhat Changed in the SDK (Source of Truth)
File:
praisonaiagents/session/store.pyBefore:
After:
The
FileLockclass insideDefaultSessionStorealready had asys.platform == "win32"branch usingmsvcrt.locking(...). The PR just makes thefcntlimport itself conditional so the module can be imported at all on Windows.If neither
fcntlnormsvcrtis available (theoretical edge case),acquire()logs a one-time warning and continues without locking:Required Documentation Update
File to update
docs/features/persistence-json.mdxWhere to insert
After the existing "How It Works" section, add a new section titled "Cross-Platform Support" before "Configuration Options".
Suggested content (follow AGENTS.md style — agent-centric, beginner-friendly, progressive disclosure)
Optional: Tiny note on
docs/features/persistence.mdxIn the existing "Storage Backend Options" card grid, the
JSON Filescard description can be tightened to reassure Windows users:(Pure copy change; no structural edits.)
Folder Placement (per AGENTS.md §1.8)
docs/features/persistence-json.mdxdocs/features/persistence.mdxdocs/concepts/docs/js/ordocs/rust/(auto-generated)SDK-First Verification Checklist (per AGENTS.md §1.2 / §1.3)
Before writing/editing, confirm against the SDK source:
praisonaiagents/session/store.pyend-to-end_HAS_FCNTLflag and thesys.platform != 'win32'guardFileLock.acquire()andFileLock.release()Windows branches usemsvcrt.lockingDefaultSessionStore,add_message,get_chat_history,list_sessions, etc. are unchanged)import praisonaiagentsexample actually works on Windows (noImportError)Quality Checklist (per AGENTS.md §9)
title,sidebarTitle,description,iconalready correct)#8B0000,#189AB4,#10B981,#F59E0B, white text,#7C90A0stroke)from praisonaiagents import Agent(friendly import, no deep paths)fcntl/msvcrtonly appear in the comparison table, not in code the user has to write)docs.json(page already registered under "Features")Out of Scope (Do Not Do)
_HAS_FCNTLor_WARNED_NO_FCNTL— these are internal sentinels.windows-support.mdx— this is one section in an existing page.docs/js/ordocs/rust/parity pages.docs/concepts/(human-approved only).Acceptance Criteria
docs/features/persistence-json.mdxcontains a new "Cross-Platform Support" section after "How It Works".from praisonaiagents import Agentimport.docs/features/persistence.mdxJSON Files card description mentions cross-platform locking.docs/features/.main, branch namedclaude/admiring-euler-CLjpN(per agent branch policy).References
praisonaiagents/session/store.pydocs/features/persistence-json.mdx,docs/features/persistence.mdxAGENTS.md(this repo)