Skip to content

fix: daemon crashing after first check cycle - #14

Open
spencer0124 wants to merge 1 commit into
aniketkarne:mainfrom
spencer0124:fix/daemon-sleep-duration-crash
Open

fix: daemon crashing after first check cycle#14
spencer0124 wants to merge 1 commit into
aniketkarne:mainfrom
spencer0124:fix/daemon-sleep-duration-crash

Conversation

@spencer0124

Copy link
Copy Markdown

Summary

  • Fix daemon process dying after its first monitoring check cycle
  • log_message uses tee which writes to stdout — when called inside calculate_sleep_duration, the stdout gets captured by $() command substitution, corrupting the sleep duration value (e.g. "[timestamp] Time remaining: 228 minutes\n600" instead of "600")
  • Replace with direct file write (>> "$LOG_FILE") to avoid stdout pollution

Test plan

  • Start daemon with claude-daemon-manager.sh start
  • Verify daemon stays running after first check with claude-daemon-manager.sh status
  • Confirm logs show "Next check in X minutes" entries (previously never reached)

🤖 Generated with Claude Code

log_message uses tee which writes to stdout. Inside calculate_sleep_duration,
this stdout gets captured by $() command substitution, corrupting the sleep
duration value and causing the daemon to crash. Write directly to the log file
instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant