#800 Stage 2 epic: agent sessions/threads (memory across run_goal)
Description
EditGive run_goal cross-call memory via dedicated tables (agent_sessions, session_messages), NOT workflow variables. Plan: ~/.claude/plans/snuggly-wibbling-dragonfly.md Stage 2. DESIGN CONFLICT to resolve first: the plan has enterprise/tools/agent.py doing session_messages SQL directly, which violates engine guidelines (api_only: no direct DB outside engine core; database_rules: SQL in engine/sql/queries/*.sql). agent.py currently does zero direct DB (durable ctx variables only). Proposed correct design: session persistence as an engine-core primitive (SQL in engine/sql/queries/, context-adaptive conn per #771, short-lived pooled conn never pinned across LLM calls); agent.py calls load at the seed gate (messages is None) and save at completion (ON CONFLICT DO NOTHING). Migration in engine migration set. Tenant-scoped every query. Sub-tickets: migration, engine sessions primitive, agent.py wiring, API /sessions CRUD + MCP surface, harness cases session_recall + session_isolation.
Comments
Loading comments...
Context
Loading context...
Audit History
View AllLoading audit history...