Skip to content

fix(storage): Persist session groups via configured storage backend#476

Merged
edenreich merged 1 commit intomainfrom
fix/session-groups-respect-storage-backend
Apr 30, 2026
Merged

fix(storage): Persist session groups via configured storage backend#476
edenreich merged 1 commit intomainfrom
fix/session-groups-respect-storage-backend

Conversation

@edenreich
Copy link
Copy Markdown
Contributor

@edenreich edenreich commented Apr 30, 2026

Closes #473.

Summary

  • Session-group state was always written to ~/.infer/session_groups.json on local disk, even when storage.type: redis (or postgres/sqlite). In Kubernetes deployments the file is ephemeral so pod restarts dropped state, defeating the point of choosing a remote backend.
  • Introduce a SessionGroupStorage interface implemented by every backend; refactor SessionRolloverManager to consume it instead of doing direct filesystem I/O.
  • JSONL keeps the file at the same path (<configDir>/session_groups.json) for backward compatibility; SQLite/Postgres get migration 002 (a session_groups table with UPSERT); Redis stores entries in a session_groups hash.

Closes #473.

The session-group index that maps stable channel keys (e.g.
`channel-telegram-12345`) to the active conversation UUID was always
written to `~/.infer/session_groups.json` on local disk, even when a
remote storage backend like Redis was configured. In Kubernetes
deployments the file is ephemeral, so pod restarts lost group state and
defeated the purpose of selecting a remote backend.

Add a `SessionGroupStorage` interface implemented by every backend
(memory/jsonl/sqlite/postgres/redis) and refactor `SessionRolloverManager`
to consume it instead of doing direct filesystem I/O. The container now
type-asserts the conversation backend into `SessionGroupStorage` and
passes it through; JSONL keeps a file at the same path for backward
compatibility, the SQL backends get a new migration `002` for a
`session_groups` table, and Redis stores entries in a `session_groups`
hash.
@edenreich edenreich changed the title fix(storage): persist session groups via configured storage backend fix(storage): Persist session groups via configured storage backend Apr 30, 2026
@edenreich edenreich merged commit 6741419 into main Apr 30, 2026
5 checks passed
@edenreich edenreich deleted the fix/session-groups-respect-storage-backend branch April 30, 2026 00:36
ig-semantic-release-bot Bot pushed a commit that referenced this pull request Apr 30, 2026
## [0.106.2](v0.106.1...v0.106.2) (2026-04-30)

### 🐛 Bug Fixes

* **storage:** Persist session groups via configured storage backend ([#476](#476)) ([6741419](6741419))
* Reasoning content preservation for thinking-mode providers ([#475](#475)) ([c5f2c3c](c5f2c3c)), closes [#474](#474)

### 🧹 Maintenance

* **nix:** Update package to v0.106.1 ([#469](#469)) ([51da75c](51da75c))
@ig-semantic-release-bot
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.106.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] session_groups.json written to disk even when storage backend is redis

1 participant