mirror of
https://github.com/dtzp555-max/memory-continuity.git
synced 2026-07-19 09:42:42 +00:00
fix: Python 3.6 compat + allow CURRENT_STATE.md override
- Replace 'Path | None' union syntax with 'Optional[Path]' (typing import) so continuity_doctor.py works on Python 3.6+ - Remove message-count guard in agent_end hook that blocked state writes when realUserMsgs.length < 2; agents can now update CURRENT_STATE.md regardless of conversation length Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -258,14 +258,7 @@ const plugin = {
|
||||
return cleaned.length > 10;
|
||||
});
|
||||
|
||||
// Don't overwrite meaningful state with trivial conversations
|
||||
// (e.g., "/new" then "what was my secret?" — only 1 real message)
|
||||
const existing = readFile(statePath);
|
||||
if (existing && buildSnapshot(existing) && realUserMsgs.length < 2) {
|
||||
log.info?.("[memory-continuity] Conversation too short to overwrite existing state (" + realUserMsgs.length + " real msgs)");
|
||||
return;
|
||||
}
|
||||
|
||||
const newState = extractStateFromMessages(messages);
|
||||
if (!newState) {
|
||||
log.info?.("[memory-continuity] No extractable state from conversation");
|
||||
|
||||
@@ -15,6 +15,7 @@ import sys
|
||||
import re
|
||||
from datetime import datetime, timezone
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -78,7 +79,7 @@ PLACEHOLDER_PATTERNS = [
|
||||
# Checks
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
def check_existence(workspace: Path, report: DiagnosticReport) -> Path | None:
|
||||
def check_existence(workspace: Path, report: DiagnosticReport) -> Optional[Path]:
|
||||
"""Check that memory/CURRENT_STATE.md exists."""
|
||||
state_file = workspace / "memory" / "CURRENT_STATE.md"
|
||||
if not state_file.exists():
|
||||
|
||||
Reference in New Issue
Block a user