Skip to main content

Background Services

The workflow daemon (khaos-wfl) orchestrates background analysis tasks, streams real-time events, and manages the analysis pipeline. It runs automatically — you don't need to manage it directly in normal use.

What It Does

  • Batch analysis — processes multiple scenes, characters, or locations concurrently
  • Progress tracking — reports completion status to the dashboard in real time
  • Error handling — retries transient failures with exponential backoff, surfaces fatal errors
  • Event streaming — pushes live updates to the web dashboard via SSE

Status

macOS

The workflow daemon is managed by the menu bar app:

# Check if running
launchctl list | grep khaos

Linux

Managed as a systemd user service:

systemctl --user status khaos-wfl

Logs

The workflow daemon logs to ~/.khaos/logs/khaos-wfl.log in NDJSON format.

# Follow live
tail -f ~/.khaos/logs/khaos-wfl.log

# Recent errors
grep '"level":"error"' ~/.khaos/logs/khaos-wfl.log | tail -10

Troubleshooting

Daemon Not Running

If analysis jobs aren't progressing:

  1. Check if the daemon process is running: ps aux | grep khaos-wfl
  2. Check logs for errors: tail -20 ~/.khaos/logs/khaos-wfl.log
  3. Restart via the menu bar app (macOS) or systemd (Linux)

Stale Socket

If the daemon crashed, it may leave a stale socket:

rm ~/.khaos/wfl.sock
# Restart the daemon

See Daemon Integration for advanced usage.