RFC: Pluggable SessionDB Provider — PostgreSQL, MySQL, and Beyond
# RFC: Pluggable SessionDB Provider — PostgreSQL, MySQL, and Beyond **Tracking Issue: (to be created)** --- ## 1. Problem Statement ### 1.1 The Hot-Update Death Spiral When running Hermes and simultaneously updating it (`git pull`/`hermes update`), the shared `state.db` SQLite file inevitably suffers: 1. **Process A (old version)** has an open SQLite connection with WAL mode, mid-write 2. **Process B (new version)** starts, tries to connect → `database is locked` 3. **WAL checkpoint** is interrupted mid-flight by SIGTERM 4. **Result**: `state.db` is corrupted, `session_search` permanently broken until manual recovery This is **not** a theoretical edge case — it's the normal development workflow for anyone running Hermes from source. ### 1.2 SQLite's Fundamental Limits in Multi-Process Hermes Hermes runs multiple processes sharing one `state.db`: | Process | Writes | Reads | |---------|--------|-------| | CLI session | ✅ Every turn | ✅ session_search | | Gateway | ✅ Every turn | ✅ session_search | | Cron scheduler | ✅ Job results | ✅ Job config | | TUI | ✅ Session list | ✅ Session list | | API server | ✅ Session creation | ✅ Query | SQLite WAL mode allows concurrent **reads**, but **writes** are serialized at the OS level. Even with the current jitter-retry + `BEGIN IMMEDIATE` design, contention causes: - **#3139** (closed, fixed): `session_search` permanently disabled on lock timeout - **#5563** (open, P1): `state.db` corruption during normal use - **#860** (close
Posted by DoubleDD on May 11, 2026, 10:08 AM
Tags
Related issues
- ⚠️ PHP CVEs. Update required!
- I think RTS could continue to work if someone made a massive leap of faith and put all the modern infra around it that a AAA extraction s...
- v2.1.113+ broken on Termux/Android: native binary requires glibc, no JS fallback
- I’m firmly anti-Tahoe and haven’t updated, and I’ve started to find Apple despicable.
- [FEATURE] Link a source control repo as the source for organization skills
- Feature Request: Option to disable paste text collapse in input field
Raise real-world problems, find people facing the same issue, and discuss solutions.2,000 issues0 comments
reliability (Sysadmin)
⚠️ PHP CVEs. Update required!
I think RTS could continue to work if someone made a massive leap of faith and put all the modern infra around it that a AAA extraction s...
RFC: Pluggable SessionDB Provider — PostgreSQL, MySQL, and Beyond
v2.1.113+ broken on Termux/Android: native binary requires glibc, no JS fallback
I’m firmly anti-Tahoe and haven’t updated, and I’ve started to find Apple despicable.
[FEATURE] Link a source control repo as the source for organization skills
Feature Request: Option to disable paste text collapse in input field
We went down the WASM sandboxing rabbit hole at Gobii when building our agent infra.
RFC: Pluggable SessionDB Provider — PostgreSQL, MySQL, and Beyond
# RFC: Pluggable SessionDB Provider — PostgreSQL, MySQL, and Beyond **Tracking Issue: (to be created)** --- ## 1. Problem Statement ### 1.1 The Hot-Update Death Spiral When running Hermes and simultaneously updating it (`git pull`/`hermes update`), the shared `state.db` SQLite file inevitably suffers: 1. **Process A (old version)** has an open SQLite connection with WAL mode, mid-write 2. **Process B (new version)** starts, tries to connect → `database is locked` 3. **WAL checkpoint** is interrupted mid-flight by SIGTERM 4. **Result**: `state.db` is corrupted, `session_search` permanently broken until manual recovery This is **not** a theoretical edge case — it's the normal development workflow for anyone running Hermes from source. ### 1.2 SQLite's Fundamental Limits in Multi-Process Hermes Hermes runs multiple processes sharing one `state.db`: | Process | Writes | Reads | |---------|--------|-------| | CLI session | ✅ Every turn | ✅ session_search | | Gateway | ✅ Every turn | ✅ session_search | | Cron scheduler | ✅ Job results | ✅ Job config | | TUI | ✅ Session list | ✅ Session list | | API server | ✅ Session creation | ✅ Query | SQLite WAL mode allows concurrent **reads**, but **writes** are serialized at the OS level. Even with the current jitter-retry + `BEGIN IMMEDIATE` design, contention causes: - **#3139** (closed, fixed): `session_search` permanently disabled on lock timeout - **#5563** (open, P1): `state.db` corruption during normal use - **#860** (close
Comments (0)
No comments yet. Start the discussion.