Skip to content

fix(librarian): register JanitorCleanupFavoritesTask in scribe priority#768

Merged
ajslater merged 1 commit into
developfrom
claude/magical-cerf-71c0e1
May 15, 2026
Merged

fix(librarian): register JanitorCleanupFavoritesTask in scribe priority#768
ajslater merged 1 commit into
developfrom
claude/magical-cerf-71c0e1

Conversation

@ajslater
Copy link
Copy Markdown
Owner

Summary

  • JanitorCleanupFavoritesTask was missing from _SCRIBE_TASK_PRIORITY, so get_task_priority() raised ValueError: tuple.index(x): x not in tuple whenever the task reached the scribe queue. The task was wired into janitor dispatch, nightly queueing, and the admin task map — only the priority tuple was missed.
  • Effect: the Cleanup Orphans Favorites admin task (and the nightly run) stayed stuck on pending forever; the librarian logged a traceback originating in scribed.py:put -> priority.py:70.
  • Fix: add JanitorCleanupFavoritesTask to the priority tuple next to the other orphan-cleanup tasks, and reorder Bookmarks/Settings to mirror _NIGHTLY_TASK_CLASSES so the two tuples stay in sync.

Reviewer notes

  • No tests currently cover get_task_priority / _SCRIBE_TASK_PRIORITY. Verified manually that get_task_priority(JanitorCleanupFavoritesTask()) returns a valid (int, float) tuple, and that every ScribeTask subclass in _NIGHTLY_TASK_CLASSES is also present in _SCRIBE_TASK_PRIORITY.
  • make fix is currently broken on macOS due to bin/fix-docker.sh using mapfile (Bash 4+ only; macOS ships Bash 3.2). Surfaced here as a separate workflow issue — not addressed in this PR.

Test plan

  • Trigger Cleanup Orphans Favorites from the admin Tasks panel and confirm it transitions out of pending and completes.
  • Trigger Janitor Nightly and confirm the favorites cleanup runs without a traceback.

🤖 Generated with Claude Code

JanitorCleanupFavoritesTask was wired into janitor dispatch, nightly
queueing, and the admin task map, but missing from _SCRIBE_TASK_PRIORITY.
When the task hit the scribe queue, tuple.index() raised ValueError, the
put silently failed, and "Cleanup Orphans Favorites" stayed pending
forever.

Add it to the priority tuple and align Bookmarks/Settings ordering with
_NIGHTLY_TASK_CLASSES so the two tuples stay in sync.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ajslater ajslater merged commit b96a386 into develop May 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant