From 451732164fa9486686dff5a616b1a90acf739ee1 Mon Sep 17 00:00:00 2001 From: Lidang-Jiang Date: Sat, 28 Mar 2026 11:38:10 +0800 Subject: [PATCH] fix(observer): clean up temp files on cd failure early return The cd "$PROJECT_DIR" failure path returned without removing prompt_file and analysis_file, leaving stale temp files in .observer-tmp/. Co-Authored-By: Claude Opus 4.6 Signed-off-by: Lidang-Jiang --- skills/continuous-learning-v2/agents/observer-loop.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skills/continuous-learning-v2/agents/observer-loop.sh b/skills/continuous-learning-v2/agents/observer-loop.sh index 51de4f61..5df24140 100755 --- a/skills/continuous-learning-v2/agents/observer-loop.sh +++ b/skills/continuous-learning-v2/agents/observer-loop.sh @@ -126,7 +126,7 @@ PROMPT # Ensure CWD is PROJECT_DIR so the relative analysis_relpath resolves correctly # on all platforms, not just when the observer happens to be launched from the project root. - cd "$PROJECT_DIR" || { echo "[$(date)] Failed to cd to PROJECT_DIR ($PROJECT_DIR), skipping analysis" >> "$LOG_FILE"; return; } + cd "$PROJECT_DIR" || { echo "[$(date)] Failed to cd to PROJECT_DIR ($PROJECT_DIR), skipping analysis" >> "$LOG_FILE"; rm -f "$prompt_file" "$analysis_file"; return; } # Prevent observe.sh from recording this automated Haiku session as observations. # Pass prompt via -p flag instead of stdin redirect for Windows compatibility (#842).