You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related to #72555: both address stale active_pr respawn guards for closed or merged PRs, but this PR makes live GitHub lookups mandatory while #72555 is the earlier broader guard-semantics approach. Maintainer selection is needed.
AI code review — automated review for reference, author can ignore or act on any point.
fix(kanban): release respawn guard for closed PRs
hermes_cli/kanban_db.py — _RESPAWN_GUARD_PR_STATE_CACHE is a module-global dict mutated without a lock: the expired-entry cleanup (for cache_key in expired: _RESPAWN_GUARD_PR_STATE_CACHE.pop(...)) will raise RuntimeError: dictionary changed size during iteration if check_respawn_guard ever runs concurrently (multiple lanes/threads, gateway + CLI in one process). Either document the single-threaded assumption next to the global or guard with a threading.Lock.
Eviction is insertion-ordered, not LRU: re-assigning an existing key (_RESPAWN_GUARD_PR_STATE_CACHE[key] = ...) does not move it to the end of the dict, so a hot URL that keeps getting refreshed sits at its original (old) position and is evicted first, while cold entries survive. collections.OrderedDict.move_to_end (or delete-then-reinsert on hit) would make the cap evict the least-recently-used entry.
Fail-closed semantics: a GitHub outage or a machine without gh caches None for 10 min per URL, so tasks stay blocked. That's the intended duplicate-PR safety trade-off, but "gh not installed" is permanent while "PR state unresolvable" is transient — distinguishing the two (e.g. cache the failure type, or skip live lookups when gh is known-absent) would avoid silently blocking tasks forever on a host that never had gh.
Minor: the 10-min cache also applies to a successfully-resolved "open" — a PR merged seconds ago still suppresses respawn for up to 10 min. Acceptable, just worth stating in the docstring alongside the window.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
comp/cronCron scheduler and job managementP3Low — cosmetic, nice to havetype/bugSomething isn't working
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
active_prrespawn guardTest plan
scripts/run_tests.sh tests/hermes_cli/test_kanban_db.py(34 passed, 1 skipped).venv/bin/ruff check hermes_cli/kanban_db.py tests/hermes_cli/test_kanban_db.pyopen; merged Replay PR feat(skills): add content size limits for agent-created skills #4391 ->merged.venv/bin/ty check ...reports 67 pre-existing diagnostics in these legacy files; none point to the added lines