fix: docs_manager 세션 기록 크래시 방지
- record_session을 try/except로 감싸서 실패해도 봇 지속 - mkdir 안전장치 추가 (에이전트가 docs/ 삭제할 수 있음) - em-dash → ASCII dash 변경
This commit is contained in:
@@ -68,12 +68,14 @@ class DocsManager:
|
||||
|
||||
def record_session(self, request: str, summary: dict, plan: dict = None) -> str:
|
||||
"""작업 세션을 기록."""
|
||||
try:
|
||||
self.sessions_path.mkdir(parents=True, exist_ok=True)
|
||||
now = datetime.now()
|
||||
filename = f"{now.strftime('%Y-%m-%d_%H%M%S')}.md"
|
||||
filepath = self.sessions_path / filename
|
||||
|
||||
lines = [
|
||||
f"# 작업 기록 — {now.strftime('%Y-%m-%d %H:%M')}",
|
||||
f"# 작업 기록 - {now.strftime('%Y-%m-%d %H:%M')}",
|
||||
"",
|
||||
f"## 요청",
|
||||
f"{request}",
|
||||
@@ -98,7 +100,7 @@ class DocsManager:
|
||||
if changes:
|
||||
lines.append("## 변경 파일")
|
||||
for c in changes:
|
||||
lines.append(f"- `{c.get('file', '?')}` — {c.get('description', '')}")
|
||||
lines.append(f"- `{c.get('file', '?')}` - {c.get('description', '')}")
|
||||
lines.append("")
|
||||
|
||||
warnings = summary.get("warnings", [])
|
||||
@@ -111,6 +113,9 @@ class DocsManager:
|
||||
filepath.write_text("\n".join(lines), encoding="utf-8")
|
||||
logger.info(f"세션 기록: {filepath}")
|
||||
return str(filepath)
|
||||
except Exception as e:
|
||||
logger.warning(f"세션 기록 실패 (무시): {e}")
|
||||
return ""
|
||||
|
||||
def append_changelog(self, entry: str):
|
||||
"""Changelog에 항목 추가."""
|
||||
|
||||
Reference in New Issue
Block a user