9fcb2da75d0e7bc9119bfeffb5e2f2d841650061
System prompt is now built fresh at conversation create/load time (in `buildSystemPrompt` capturing current SOUL/skills/toolsets/reflections) and passed into LiteConversationConfig.systemInstruction. It is NOT written to working_memory anymore. Why: ChatAgent was freezing the system prompt into a WorkingMemoryEntry.System row at createConversation, then reading it back on every getOrCreateLiteConversation. This meant changing SOUL, activating toolsets, adding skills or new reflections between agent restarts did not propagate to existing conversations without re-running createConversation. Fix: - ChatAgent.createConversation: dropped the workingMemoryStore.append(System(...)) - ChatConversation.getOrCreateLiteConversation: replaces the WM-based lookup with the in-memory systemPrompt field directly - ChatConversation.compactPreTurn: same simplification — compaction operates only on User/Assistant rows (plus future Summary rows); system prompt is excluded Migration: none. Old DBs may contain dead System rows from prior versions — they are simply ignored by the new lookup, and compaction never reads them. Tests: 340/340 green. Updated 7 tests across ChatAgentTest + MemoryWiringTest that asserted the old System-in-working-memory contract; they now verify the system prompt via LiteConversationConfig.systemInstruction (what LLM actually sees). E2E verified: 0 system rows in working_memory across all conversations, multi-turn history reconstructs correctly after agent restart with the updated in-memory system prompt.
Description