redhat-et / redhat-et/docsclaw

feat: add bounded memory protection for session store

Open
#52 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
2
Forks
1
Avg merge
6h 9m
Merged PRs (30d)
1

Description

Summary

The in-memory session store (internal/session/store.go) has no limits on the number of sessions or messages per session. A misbehaving client could exhaust server memory.

What to add

  • Max sessions: configurable limit (e.g., 1000), reject new sessions with an error when exceeded or evict LRU
  • Max messages per session: configurable limit (e.g., 200 messages), trigger compaction or truncation when exceeded
  • Session ID validation: currently truncated to 64 chars; consider restricting to alphanumeric + hyphens

Related

  • Deferred from PR #51 (Kimi review finding #2)
  • Part of #5 (Memory and context persistence)
  • Max messages limit is a prerequisite for context compaction (#5 Phase 3)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with internal/session/store.go and trace how sessions and messages are created, stored, and identified. Clarify whether limits should reject or evict sessions, and whether message overflow should compact or truncate. Done means configurable protections cover session count, per-session messages, and the stated session ID validation requirement.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.