Establish session persistence and mediation (mediate-session)#31
Merged
Conversation
- SessionManager: file-based persistence to ~/.caichat/sessions/<name>.json - persist_session_to_file(): serialise metadata + messages as JSON - load_session_from_file(): deserialise and replay messages on resume - get_session_file_path(): creates directories with proper error reporting - Bidirectional name<->id maps for O(1) lookup - resume_session() tries memory, AtomSpace, then file before creating new - mediate_session() always persists (active or inactive) - persist_session() uses reverse map for O(1) name lookup - caichat.scm: export caichat-create-persistent-session, caichat-resume-session, caichat-mediate-session, caichat-audit-core-modules, caichat-neural-symbolic-bridge; remove Scheme wrappers that shadowed C++ bindings - init.scm: re-export caichat-create-persistent-session and caichat-resume-session - repl.scm: update help text; add /persist, /resume, /mediate REPL commands Co-authored-by: drzo <15202748+drzo@users.noreply.github.com> Agent-Logs-Url: https://github.com/HyperCogWizard/caichat/sessions/4fb16d77-6bd3-4244-b583-4f0c74ef53ea
Copilot
AI
changed the title
[WIP] Establish session persistence and mediation
Establish session persistence and mediation (Mar 25, 2026
mediate-session)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sessions had no file-based persistence —
mediate_sessiononly wrote to AtomSpace (when available), andresume_sessionhad no fallback for cross-process recovery. The Scheme module also shadowed the C++SessionManagerbindings with weaker pure-Scheme wrappers and omitted key exports.C++ (
SessionManager)persist_session_to_file()serialises metadata + full message history to~/.caichat/sessions/<name>.json;load_session_from_file()deserialises and populatesrestored_messagesfor replay into the restoredChatCompletionresume_session(): now checks memory → AtomSpace → file before creating a new session; replays messages back into the live completion instancemediate_session(): always persists (previously skipped active sessions, leaving their state unwritten)persist_session(): uses a newsession_id_to_name_reverse map for O(1) name lookup instead of linear scanget_session_file_path(): creates~/.caichat/sessions/tree witherrno-aware error reportingsession_name_to_id_/session_id_to_name_maps maintained across all session lifecycle callsScheme
caichat.scm: exportscaichat-create-persistent-session,caichat-resume-session,caichat-mediate-session,caichat-audit-core-modules,caichat-neural-symbolic-bridge; removes Scheme wrappers that shadowed the C++ bindingsinit.scm: re-exportscaichat-create-persistent-sessionandcaichat-resume-sessionrepl.scm: adds/persist <name>,/resume <name>,/mediateinteractive commands and updates help textOriginal prompt
mediate-session) #15📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.