Skip to the content.

Task 103 — PostgreSQL session store

Phase: 8 Status: in_progress (shipped as staged + restart-gated; live switch needs an owner decision) Owner: — Slug: postgres-session-store Studio Stage: 6

Status note (2026-10-07, 2.0.0 release prep). Shipping as partial, by design — in_progress is accurate and should not be tidied to done. The Postgres store and the restart-gated selection UI are implemented; what is deliberately not implemented is the live, no-restart switch, because Storage:SessionStore is read from IConfiguration (not AppConfig) and switching backends at runtime risks data loss. Closing the gap requires changing where the agent reads that setting, which is an owner decision rather than a ticket to grind down. Shipped as a documented limitation in CHANGELOG-EN.md / CHANGELOG-RU.md. Evidence: VERIFICATION.md § “Stage 6.12”.

Goal

Абстракция ISessionStore + Postgres implementation для централизованного хранения сессий всех агентов. Опция “collective mind mode” — shared memory между агентами.

Acceptance criteria

Sub-tasks

Implementation notes

Validation

Follow-ups (next roadmap tick)

  1. Implement the remaining PostgresSessionStore methods: durable tasks (SaveDurableTaskAsync / LoadDurableTaskAsync / etc.), checkpoints, escalations, sandbox, skill-evaluations, audit filter queries (GetAuditLogByTargetAsync, GetAuditLogQueryAsync), reflection queries (GetLowConfidenceAsync, GetSessionInteractionsAsync, GetModeStatsAsync, etc.). Tracked in this task file as NotImplementedException stubs.
  2. Add NpgsqlDataSource pooling and SELECT … FOR UPDATE SKIP LOCKED for multi-agent shared-DB scenarios.
  3. Implement collective-mind semantics: when StorageConfig.CollectiveMind.Enabled = true + SessionIsolation = "shared", route session reads across all agents; for now the config is plumbed but the policy layer is a follow-up.
  4. SQLite → Postgres migration tooling (export/import script). Not required for greenfield Postgres deployments.

Dependencies

Scope / Likely files

src/agent/Storage/ISessionStore.cs (new), src/agent/Storage/SqliteSessionStore.cs (refactor), src/agent/Storage/PostgresSessionStore.cs (new), src/agent/Config/AppConfig.cs, src/agent/Program.cs