What problem does this solve?
Currently all conversation history is lost when the user exits lmcode chat. Users have no way to review what the agent did in a previous session, which makes debugging and auditing harder.
Proposed solution
Record each session to a JSONL file in ~/.local/share/lmcode/sessions/ so sessions can be replayed, searched, or resumed later.
Design:
- Each session gets a unique ID (timestamp-based, e.g.
2026-03-22T14-05-00)
- Events saved:
session_start, user_message, assistant_message, tool_call, tool_result, session_end
- Storage path:
~/.local/share/lmcode/sessions/<id>.jsonl (via config/paths.py)
- Event models already exist in
session/models.py (stub)
- Recorder stub in
session/recorder.py (needs implementation)
Scope:
- Wire up
SessionRecorder in agent/core.py — emit events at each turn
- Implement
session/recorder.py — append JSONL lines
- Implement
session/storage.py — list + load sessions
Roadmap: v1.0 (required before session viewer can be built)
Alternatives considered
None considered.
What problem does this solve?
Currently all conversation history is lost when the user exits
lmcode chat. Users have no way to review what the agent did in a previous session, which makes debugging and auditing harder.Proposed solution
Record each session to a JSONL file in
~/.local/share/lmcode/sessions/so sessions can be replayed, searched, or resumed later.Design:
2026-03-22T14-05-00)session_start,user_message,assistant_message,tool_call,tool_result,session_end~/.local/share/lmcode/sessions/<id>.jsonl(viaconfig/paths.py)session/models.py(stub)session/recorder.py(needs implementation)Scope:
SessionRecorderinagent/core.py— emit events at each turnsession/recorder.py— append JSONL linessession/storage.py— list + load sessionsRoadmap: v1.0 (required before session viewer can be built)
Alternatives considered
None considered.