feat: add kanban PR review polling loop - #29413
Conversation
teknium1
left a comment
There was a problem hiding this comment.
Thanks for re-scoping this onto the existing review lifecycle. Two blocking issues need correction before this can provide the documented polling behavior.
Problems
hermes_cli/kanban_pr_review.py:297reads onlylatest_run()for PR metadata. Current main creates a newer, metadata-free review run inclaim_review_task()(hermes_cli/kanban_db.py:3538-3559), andlatest_run()selects that newest run (hermes_cli/kanban_db.py:8916-8923). After dispatch starts the review worker,pr-review-polltherefore cannot locate the original PR reference.hermes_cli/kanban_pr_review.py:332requestsconclusionfromgh pr checks --json. The current CLI rejects that field;_gh_json(..., default=[])suppresses the error and makes all checks appear absent.
Suggested changes
- Persist or search historical PR metadata across the implementation handoff and review run; add an end-to-end DB test for poll-after-review-claim.
- Use supported
gh pr checksfields (bucket/state) and test the actual constructed command shape.
Automated hermes-sweeper review.
| if not task: | ||
| raise ValueError(f"unknown task {task_id}") | ||
| run = kb.latest_run(conn, task_id) | ||
| ref = pr_reference_from_task(task, run) |
There was a problem hiding this comment.
latest_run() becomes the newly-created review-agent run as soon as the dispatcher claims the card, but that run has no copied PR metadata. The original implementation handoff is then older, so this raises before polling. Resolve the latest run that contains PR metadata, or persist the normalized PR reference across the review handoff.
| cmd = [ | ||
| "gh", "pr", "checks", ref.selector, "--json", | ||
| "name,state,conclusion,link,bucket,workflow", | ||
| ] |
There was a problem hiding this comment.
gh pr checks --json does not support conclusion (the CLI reports only bucket, completedAt, description, event, link, name, startedAt, state, and workflow). This command fails and the default [] path hides it, so check failures and pending checks are never detected. Classify the supported bucket/state fields instead.
Summary
reviewstatus instead of addingin_review/code_review/merge_ready.reviewwhile preserving run metadata, avoidingcompleted_at, and preventing dependent tasks from unblocking prematurely.hermes kanban pr-review-poll <task_id>plus parser/poller logic forgh pr view,gh pr checks, requested changes, unresolved review threads, closed-unmerged PRs, and seen-item dedupe.Test plan
python -m pytest tests/hermes_cli/test_kanban_pr_review.py tests/hermes_cli/test_kanban_cli.py tests/hermes_cli/test_kanban_db.py tests/hermes_cli/test_kanban_core_functionality.py tests/tools/test_kanban_tools.py -o 'addopts=' -q-> 462 passedgit diff --check-> passedpython -m compileall -q hermes_cli/kanban_pr_review.py hermes_cli/kanban.py hermes_cli/kanban_db.py-> passedNotes
tw3akercc/hermes-agent:feat/kanban-pr-review-poller-v2.