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:
2026-03-19 07:13:26 +10:00
co-authored by Claude Sonnet 4.6
parent 33c3558625
commit 312d892853
2 changed files with 2 additions and 8 deletions
+2 -1
View File
@@ -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():