Sessions are implemented as a partitioned ledger in SQLite. Every interaction is tagged with a session_id.
Sessions provide isolation of history.
- Mechanism: The
messagestable includes asession_idfor every entry. - Prompt Construction: The
Orchestratorqueries only messages associated with the activesession_idwhere status is not 'dropped'. - Result: The LLM has no visibility into other sessions.
Sessions are designed to be stable across model switches. However, because different providers (like Google and OpenAI) use incompatible tool-calling schemas, std::slop implements tool call isolation.
- Conversational Text: Regular user and assistant messages are preserved and automatically re-parsed when you switch models.
- Tool Isolation: Tool calls and their results are scoped to the provider strategy that created them. If you switch from Gemini to an OpenAI model, the OpenAI model will see the previous conversation text but will not see the Gemini-specific tool calls or results. This prevents parsing errors and "hallucinations" caused by cross-provider format mismatches.
While history is isolated, certain configurations are global or preserved in memory when switching.
| Feature | Scope | Persistence |
|---|---|---|
| Message History | Session | SQLite (messages table) |
| Global Anchor (State) | Session | SQLite (session_state table) |
| Context Window Size | Session | SQLite (sessions table) |
| Note: Global Anchor (State) is persistent across history pruning and session restarts. | ||
| Active Skills | Process | In-memory (Preserved on /session) |
| Request Throttle | Process | In-memory (Preserved on /session) |
| Tool Registry | Global | SQLite (tools table) |
| Skills Registry | Global | SQLite (skills table) |
The /session switch <name> command updates the internal session pointer.
- Creation: If the session name does not exist, it will be implicitly created upon the first message sent to the LLM (when the first record is written to the ledger).
- What Changes: The history retrieved for prompt assembly and the session-specific "Global Anchor" state.
- What Stays: Your currently activated skills and any
/throttlesettings. This allows you to quickly pivot to a new "thread" or project without re-configuring your preferred persona or agentic behavior.
Use /session list to see all sessions that have stored history.
To completely clear your context for a new task, simply /session switch to a new name (e.g., /session switch project_part_2). This is the recommended way to start fresh.
Alternatively, you can use /session clear to wipe the current session's history while remaining in that session.
The /session remove <name> command permanently deletes a session and all its associated data (history, token usage stats, persistent state, and context settings).
- If the current active session is removed, the system automatically switches to
default_session.
The /session clone <name> command creates a complete "branch" of the current session.
- What is copied: All message history, persistent state, and token usage history.
- Uniqueness: The target name must not already exist.
- Use Case: This is suitable for exploring different "branches" of a task or saving a stable state before a complex change. After cloning, you are automatically switched to the new session.
The /session clear command deletes all data (history, token usage stats, persistent state) for the current session and rebuilds the context (making it empty). This is useful if you want to restart a task without changing the session name.
The ledger is stored in slop.db and persists across restarts. Resume a session by providing its name at startup or via /session.
When running in Batch Mode (--prompt), std::slop will use the provided --session (or default_session if none specified) to retrieve context and store the new interaction. This allows for automated "updates" to a persistent project context.
| Feature | Isolated per Session? |
|---|---|
| Message History | Yes |
| LLM Context Window | Yes |
| Global Anchor State | Yes |
| Tool Registry | No |
| Skills Registry | No |
| Active Skills | No (Preserved on switch) |
| Request Throttle | No (Preserved on switch) |
| FTS5 Search Index | No |