Files
loki/scripts
g-but 48fa2b67fb fix(daemon): delete stale /tmp/agent-current-prompt-<tab> in push loop
Companion to the UI staleness gate. Closes the leak at the source so
the sentinel doesn't keep getting re-pushed every 2s — fires the same
two checks the UI uses (session-mtime newer than prompt-start, OR
prompt older than 30min) inside _push_loop, deletes the file, and
clears cpk/cpl/cpsat so the JSON pushed to /api/control/runtime-state
carries nulls.

Verified against live state:
  - OrangeCat: 3-day-old "echo ui-dispatch-test" prompt → cleared
    after daemon restart (DB row's current_prompt_started_at went
    null within one push interval).
  - revamp-it: 30-min-old "Auto: next_best" → cleared on next push.

Companion to:
  fix(control): stale "Working" defense — gate currentPrompt by
  session signals + time
2026-05-20 15:23:52 +02:00
..