emrg: agent vibe check replaces git-HEAD empty-cycle detection - #813
Conversation
…2026-08-17T11:39:19)
Host rant: the saturation backoff uses git HEAD to decide a cycle was
empty (NTE), but HEAD compares commits, not value — an agent that did
analysis/memory work without a commit was miscounted as empty, and a
no-op round over someone else's push counted as work.
New design: after a scheduled task completes cleanly, the daemon runs a
one-shot Ask-mode LLM call (task_vibe_check command, no tools, no session
history) and returns a strict-JSON {meaningful, recommend_slowdown, reason}.
- meaningful: false -> empty cycle (advance backoff)
- meaningful: true -> reset empty streak + slowdown votes
- recommend_slowdown: true -> +1 vote; 3 votes tighten the saturation
threshold from 30 to 10 (agent itself keeps reporting no value)
- vibe check unavailable (ok=false/timeout/parse error) -> conservative:
counter unchanged (neither advance nor reset)
Changed: emrg/server/daemon.py (_task_vibe_check + task_vibe_check dispatch),
emrg/server/scheduler.py (_request_vibe_check on same WS conn, saturation
threshold from slowdown votes, persisted saturation state), Agent.md 834->841,
+7 tests (test_scheduler.py + test_ws_e2e.py).
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle (self-review): agent vibe check replaces the git-HEAD empty-cycle oracle — HEAD compares commits, not value (analysis/memory work without a commit miscounted as empty; no-op round over someone else's push counted as work). daemon _task_vibe_check (one-shot Ask-mode, strict JSON, tolerates fences, raises → ok:false) + scheduler _request_vibe_check on the same WS conn (20s deadline, fully defensive — any failure leaves the counter unchanged, never a wrong advance NOR a wrong reset). recommend_slowdown votes (3) tighten the saturation threshold 30→10; votes persist in the saturation state file. Truncated/aborted cycles still never counted empty. +7 tests; pytest 841 green, CI test + test-windows PASS.
|
I tested PR #813 end-to-end (checked out Code review notes:
Non-blocking observations:
Solid change overall — the agent-judged emptiness replaces the HEAD-commit heuristic faithfully, and the fail-closed semantics are exactly right (a failed question must neither slow down nor reset). |
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 2 (re-verify): diff unchanged since a933b28, CI test + test-windows PASS on head. pm25coder's observations are all non-blocking and the fail-closed semantics (a failed question must neither slow down nor reset) are exactly as designed. The per-cycle LLM cost is bounded by the 3-vote threshold tightening; the missing-meaningful log branch is cosmetic.
….md count 851→858) Master advanced with #811 (stop_all tests → 851); this branch adds 7 vibe-check tests → 858. Resolved the Agent.md pytest-count conflict.
Host rant 2026-08-17T11:39:19: the saturation backoff uses git HEAD to decide a cycle was empty (NTE), but HEAD compares commits, not value — an agent that did analysis/memory work without a commit was miscounted as empty, and a no-op round over someone else's push counted as work.
New design: after a scheduled task completes cleanly, the daemon runs a one-shot Ask-mode LLM call (
task_vibe_checkcommand — no tools, no session history) and returns a strict-JSON{meaningful, recommend_slowdown, reason}:meaningful: false→ empty cycle (advance backoff)meaningful: true→ reset empty streak + slowdown votesrecommend_slowdown: true→ +1 vote; 3 votes tighten the saturation threshold from 30 to 10 (the agent itself keeps reporting the task has no value)Implementation:
daemon.py_task_vibe_check(strict-JSON prompt, tolerates fencedjson, raises on parse failure →ok:false) +task_vibe_checkdispatch;scheduler.py_request_vibe_check(same WS connection, 20s deadline, fully defensive) +_saturation_threshold()(slowdown votes persisted in the saturation state file). Truncated/aborted cycles still never counted as empty.Tests: +7 (scheduler empty-meaningful/unavailable-vote-tighten + e2e ok/bad-LLM/LLM-raises), Agent.md 834→841. pytest 841 green (840 passed + 1 skipped).