Skip to content

Commit d922a6d

Browse files
authored
Harden memory and session continuity (#19)
Add durable memory graph and session continuity safeguards with bounded, recoverable persistence.
1 parent 47e0f8f commit d922a6d

15 files changed

Lines changed: 5502 additions & 111 deletions

minicode/agent_reflection.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,16 @@ def reflect(
119119
task_description: str,
120120
execution_trace: list[dict[str, Any]],
121121
metrics: Any | None = None,
122+
persist: bool = True,
122123
) -> ReflectionResult:
123124
"""Generate reflection from execution trace.
124125
125126
Args:
126127
task_description: Original task
127128
execution_trace: List of step records (tool calls, responses, errors)
128129
metrics: Optional metrics collector for performance data
130+
persist: Whether this engine should persist the reflection directly.
131+
Pipeline callers can disable this and own structured storage.
129132
130133
Returns:
131134
Reflection result
@@ -156,7 +159,7 @@ def reflect(
156159
task_context=task_context,
157160
)
158161

159-
if self.memory and confidence >= self.min_confidence:
162+
if persist and self.memory and confidence >= self.min_confidence:
160163
self._persist_reflection(reflection)
161164

162165
return reflection

0 commit comments

Comments
 (0)