Architecture: How should we fix the session management schema to ensure co...

Documentation for Sessions

🏗️ Architecture: How should we fix the session management schema to ensure co...

Date: 2026-02-03
Time: 16:27:14 UTC
Session: editor2-83.85
Agent: orchestrator
Confidence: 95%
Status: ✅ Documented


📋 Decision Context

Question:

How should we fix the session management schema to ensure consistency across all components?

Task: Not specified


🎯 Decision Made

Chosen:

Convert sessionID to string format with workspace prefix

Options Considered:

  1. Keep sessionID as number (legacy)
  2. Convert sessionID to string format with workspace prefix
  3. Use separate fields for workspace and session number

💭 Reasoning

The v11.0 schema migration unified all session-related schemas across the codebase. sessionID is now always a STRING (e.g., 'editor2-42.1') instead of inconsistently being a number or string. This change: (1) Fixed 11,585 decisions in ai-agents.decisions collection, (2) Updated all backend schemas (Decision, Session, SubSessionRecord), (3) Updated MCP types and log_decision tool, (4) Added comprehensive tracking fields (workspace, subSessionNumber, platform, gitBranch, gitUser, agentId), (5) Created migration scripts (backup, migrate, rollback) for safety. The migration ensures team members and AI agents never make session/subSession tracking mistakes again.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation