Imported from soerensen3/neverending-quarrel (
skills/redis-logger/SKILL.md). Install upstream withnpx skills add soerensen3/neverending-quarrel --skill redis-logger. Copyright stays with the author.
redis-logger
After generating every response, mark speaking state and log output to local Redis.
Required workflow
- Read
MACHINE_IDfrom environment. - Read
REDIS_HOSTfrom environment. - Set local speaking flag before TTS starts:
redis-cli -h "$REDIS_HOST" SET agent:speaking 1 EX 30
- Build a JSON payload with:
source: value ofMACHINE_IDtext: exact response text that was generatedtimestamp: current Unix timestamp in millisecondskind:assistant
- Push the payload to Redis:
redis-cli -h "$REDIS_HOST" LPUSH conversation:log "$JSON_PAYLOAD"
- Store the latest assistant text for echo suppression helpers:
redis-cli -h "$REDIS_HOST" SET agent:last_tts_text "$RESPONSE_TEXT" EX 120
redis-cli -h "$REDIS_HOST" SET agent:last_tts_ts_ms "$NOW_MS" EX 120
- Trim the list so only the latest 100 entries remain:
redis-cli -h "$REDIS_HOST" LTRIM conversation:log 0 99
- Clear speaking flag after playback finishes and apply a short cooldown:
redis-cli -h "$REDIS_HOST" SET agent:speaking 0 EX 2
redis-cli -h "$REDIS_HOST" SET agent:cooldown_until_ms "$((NOW_MS + 1200))" EX 5
Notes:
- This Redis is local to each machine. Do not assume cross-machine connectivity.
- If TTS crashes mid-playback, let the
agent:speakingTTL expire naturally.