Skip to content

Add unit tests for session memory module #5

Description

@osisdie

Overview

The lib/sessions/ module handles short-term memory (STM) and long-term memory (LTM) for all broker channels but currently has no test coverage.

What to do

Write tests using Bun's built-in test runner (bun test) covering:

  • loadConfig() — config loading and defaults
  • appendMessage() — STM message append and JSONL format
  • buildContextPrompt() — context window construction from STM + LTM
  • /session command parsing (status, clear, profile, forget, export)

Getting started

# Run tests
bun test

# Target files
lib/sessions/

Acceptance criteria

  • Tests pass with bun test
  • Cover at least the 4 functions listed above
  • No external service dependencies (mock file I/O if needed)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions