github Ruya-AI/cozempic v1.8.30
v1.8.30 — active-transcript session detection + guard-loop watchdog

latest releases: v1.8.39, v1.8.38, v1.8.37...
5 months ago

v1.8.30 — follow Claude Code's active transcript for session detection + guard-loop watchdog

Two real bugs that bit live this cycle, plus the process change so the class doesn't recur.

1. Wrong-session detection (the f464a40c incident)

cozempic current / /cozempic reload could resolve the wrong session when the active session lived in a different project dir than the invocation cwd — find_current_session inferred it from cwd → project slug → most-recent file, picking a stale session.

Fix: record the transcript_path Claude Code hands the SessionStart hook, keyed by the live Claude PID (one claude process == one session — precise where cwd is not), and consult it first. The manual CLI path now follows CC's own active session instead of guessing.

2. Guard-loop watchdog (cozempic guard-watchdog)

The in-process circuit breaker only protects daemons running the fixed code; an old/broken daemon that fails to self-arrest keeps churning. The new command scans guard logs for the futile-churn signature and reports by default (--fix SIGTERMs a live looping daemon). Run it on a schedule as a standing safeguard.

Ground-truth correction: the captured real f641174c log showed the pathology was a respawn storm — 23 daemon starts, 216 futile prunes, 21 K-exits. Each daemon did self-arrest, yet the storm continued. So "saw an exit line" is not proof of health; the detector flags futile-churn dominance, exit or no exit. (The committed real-log corpus fixture pins this.)

3. Longitudinal loop test

Drives the real guard daemon loop for N cycles against an unprunable session and asserts it K-exits + backs off — testing the system over time, not a diff. This is the test class that catches emergent loops a diff-scoped suite misses.

+27 tests (detection, watchdog incl. real corpus, longitudinal loop). brew upgrade cozempic to get it.

Don't miss a new cozempic release

NewReleases is sending notifications on new releases.