[0.7.1] — 2026-05-20
Hotfix for a race condition in the MRP REFINE phase that surfaced while
compiling longer source documents (observed on
meeting-notes-260519-2124-chien…). No schema migration, no API change.
Fixed
- MRP REFINE concurrent-session race — Phase 3 fanned out up to
MAX_WRITER_CONCURRENCYpage writers viaasyncio.gather, all
sharing the orchestrator's singleAsyncSession. SQLAlchemy
AsyncSessionis not safe for concurrent use, so simultaneous
get_page_by_sluglookups (UPDATE fetches plus theread_kb_page
tool inside the complex writer's agent loop) raced and corrupted
the session, causing intermittent draft generation failures on
documents with several UPDATE pages or a large existing wiki.
Each_write_onenow opens its own session from
async_session_factory; the orchestrator's session is reserved for
the finalplan.plan_jsoncommit.