gabriel / musehub public
fix fix/worker-reclaim-commit-gate #1 / 1
AI Agent gabriel · 14 hours ago · Oct 21, 2026 · Diff

fix: worker's reclaim-stale-jobs commit was gated on the wrong count

_process_one's poll loop called reclaim_stale_jobs() but only committed when its return value (count of jobs reset to 'pending') was truthy. MWP9's reclaim_stale_jobs fix added a second UPDATE -- terminally failing exhausted stale jobs -- without changing that return value, so whenever the only stale rows were exhausted ones, the commit was skipped entirely and the 'failed' UPDATE was silently rolled back on session close.

Confirmed live on staging: after deploying the MWP9 reclaim fix, the worker logged '❌ Terminally failed 2 exhausted stale job(s)...' on every single 1s poll cycle, forever, for the identical two job IDs -- the clearest possible signature of an update that runs but never persists.

Fix: commit unconditionally after reclaim_stale_jobs. It's two UPDATE statements with narrow WHERE clauses; committing an empty transaction when neither matches is free.

sha256:743e3346e49f299132ca3e46eb44c086c29c38cee18fc21dab892e6815f38b43 sha
~1 symbols
1 changed · 1084 in snapshot files
sha256:883ed04a43654f6262fdc9246001f2734ddab32c3bb34a97477658df7e9f245b snapshot
~1
symbol modified
1
file changed
1084
files in snapshot
0
dead code introduced
Semantic Changes 1 symbol
~ musehub/worker.py .py 1 symbol modified
Files Changed
~1
1084 in snapshot
← Older Oldest on fix/worker-reclaim-commit-gate
All commits
Newer → Latest on fix/worker-reclaim-commit-gate

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:743e3346e49f299132ca3e46eb44c086c29c38cee18fc21dab892e6815f38b43 --body "your comment"