fix(kanban): restore native GitHub PR ingest - #8
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: abafe6ab2c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| initial_status="blocked" if status == "blocked" else "running") | ||
| with write_txn(conn): | ||
| conn.execute("UPDATE tasks SET status = ?, claim_lock = NULL, claim_expires = NULL, worker_pid = NULL WHERE id = ?", (status, task_id)) | ||
| _append_event(conn, task_id, "github_pr_ingested", details) |
There was a problem hiding this comment.
Keep failed-check cards blocked across dispatcher ticks
When a PR is ingested with failed checks or a merge conflict, this records only github_pr_ingested; it never records the blocked event that _has_sticky_block() requires. On the next dispatcher tick, recompute_ready() therefore treats the parentless blocked card as recoverable, promotes it to ready, and may dispatch an implementation worker despite the failed gate. Cover the ingest-to-dispatch path and persist a block marker that the dispatcher honors.
AGENTS.md reference: AGENTS.md:L84-L87
Useful? React with 👍 / 👎.
| if should_update_status and existing["status"] != status: | ||
| conn.execute( | ||
| "UPDATE tasks SET status = ?, claim_lock = NULL, claim_expires = NULL, worker_pid = NULL WHERE id = ?", | ||
| (status, existing["id"]), |
There was a problem hiding this comment.
End active review runs before applying webhook state changes
If the review card has already been claimed, a same-head check or close delivery reaches this raw update while status='running'. It clears the task lock and worker PID without closing current_run_id or the corresponding task_runs row; a passing check can then make the card claimable by a second reviewer while the first process remains alive, while a close leaves a permanently active run whose worker can no longer complete the now-done task. Apply these webhook transitions through lifecycle-aware run termination instead.
AGENTS.md reference: AGENTS.md:L84-L87
Useful? React with 👍 / 👎.
| p_ingest_pr.add_argument("--title", required=True, help="PR title") | ||
| p_ingest_pr.add_argument("--assignee", default=None, help="Reviewer profile") | ||
| p_ingest_pr.add_argument("--url", default=None, help="PR URL") | ||
| p_ingest_pr.add_argument("--draft", action="store_true") |
There was a problem hiding this comment.
Preserve draft state on check-only deliveries
Because --draft is a one-way store_true flag, a check-suite invocation that does not carry PR draft state is indistinguishable from an explicit non-draft update. After a draft PR is parked in triage, running the same-head ingest with --checks-passed true but no --draft computes review and dispatches review prematurely even though the PR remains a draft. Draft needs tri-state handling or preservation from the existing card when the delivery omits it.
AGENTS.md reference: AGENTS.md:L84-L87
Useful? React with 👍 / 👎.
| should_update_status = action in {"closed", "merged", "reopened"} | ||
| should_update_status = should_update_status or checks_passed is not None or mergeable is not None | ||
| if should_update_status and existing["status"] != status: |
There was a problem hiding this comment.
Do not resurrect closed PR cards on delayed checks
When a PR card has already been set to done by a closed or merged delivery, any delayed same-head check delivery with checks_passed or mergeable set satisfies this condition and rewrites the terminal card to review or blocked because the action defaults to open. Out-of-order webhook delivery can therefore enqueue review work for an already closed or merged PR; terminal cards should remain terminal unless an explicit reopened event arrives.
AGENTS.md reference: AGENTS.md:L84-L87
Useful? React with 👍 / 👎.
Orion Review — changes requiredReviewed immutable head P1 — same-head webhook replay can orphan/duplicate an active review
Acceptance: preserve a running same-head review's assignee, status, claim, PID, and run pointer; metadata-only refreshes must not make it dispatchable again. Restore the canonical behavior already present in P1 — this is not the canonical upstream-aligned lifecycle
The current code also creates a new Acceptance: port the full canonical P1 — required regression coverage was reducedOnly four ingest tests were added to Acceptance: restore the focused CLI + DB tests from No GitHub checks are configured on this fork branch. Do not merge or refresh the active runtime until the same PR is updated and resubmitted to Orion. |
b4d2878
into
dev/hermes-upgrade-t_16bbffad
* fix: allow kimi k3 vision auto-routing * chore: preserve local reasoning-relay + TUI fast-echo fixes before v2026.7.20 upgrade - agent/conversation_loop.py: prioritise structured reasoning fields over inline-think content for tool_progress_callback relay - ui-tui appLayout.tsx: drop stale inputHeight box sizing (auto-size from rendered content instead) - ui-tui textInput.tsx: cancel pending fast-echo parent update on submit * fix(prompt): apply root policy to named profiles * chore: reconcile local Hermes changes with v2026.7.30 * feat(kanban): route implementation handoffs through review * fix(kanban): allow requeued review workers past PR guard (#9) * fix(kanban): allow requeued review workers past PR guard * fix(kanban): preserve review routing after crash requeue * fix(kanban): preserve native review lane on crash * fix(kanban): apply retry guards to native reviews * fix(kanban): guard native review respawns during cooldown --------- Co-authored-by: SoLo <solo@SoLoBot> * fix(kanban): expose native review initial status (#7) Co-authored-by: SoLo <solo@SoLoBot> * fix(kanban): restore native GitHub PR ingest (#8) * fix(kanban): restore native GitHub PR ingest * fix(kanban): restore GitHub PR lifecycle safeguards --------- Co-authored-by: SoLo <solo@SoLoBot> --------- Co-authored-by: SoLo <solo@SoLoBot>
* fix(kanban): restore native GitHub PR ingest * fix(kanban): restore GitHub PR lifecycle safeguards --------- Co-authored-by: SoLo <solo@SoLoBot>
…eview #8) test_progress_extends_idle_budget_until_success raced wall-clock: the 0.1s-idle/0.04s-tick shape left ~60ms of slack per tick, so one slow scheduler pass on a loaded CI box lapsed the idle budget mid-loop. Widened to 0.5s idle / 0.1s ticks (5x per-tick margin, total runtime still <1s) per the FLAKY policy's minimum-margin guidance.
docs(relay): explain canonical operation migration
Summary
hermes kanban ingest-prparser/handler and idempotent DB materializationgithub_pr_native_ingestmetadata and dedupe by repository/PR/head SHAVerification
HERMES_PYTHON=/home/solo/.hermes/hermes-agent/venv/bin/python scripts/run_tests.sh tests/hermes_cli/test_kanban_cli.py(7 passed)PYTHONPATH=. python -m py_compile ...andgit diff --checkpassedingest-pr/home/solo/.hermes/hermes-agent/venv/bin/hermescurrently does not exposeingest-pr; deployment/runtime refresh is still required before claiming webhook monitoring is liveRouter baseline record:
run-20260801T080505-deb06eea, blocked_baseline_failed; Orion authorized one-time DEV-direct fallback for this repair.