Skip to content

fix(kanban): restore native GitHub PR ingest - #8

Merged
solovision24 merged 2 commits into
dev/hermes-upgrade-t_16bbffadfrom
hermes-agent/t_36dcfe9e-dev-restore-active-github-pr-ingest-and
Aug 2, 2026
Merged

fix(kanban): restore native GitHub PR ingest#8
solovision24 merged 2 commits into
dev/hermes-upgrade-t_16bbffadfrom
hermes-agent/t_36dcfe9e-dev-restore-active-github-pr-ingest-and

Conversation

@solovision24

Copy link
Copy Markdown
Owner

Summary

  • restore hermes kanban ingest-pr parser/handler and idempotent DB materialization
  • route clean PRs to Review, drafts to triage, and failed checks/conflicts to blocked
  • preserve github_pr_native_ingest metadata and dedupe by repository/PR/head SHA

Verification

  • 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 ... and git diff --check passed
  • task-branch CLI help exposes ingest-pr
  • exact adapter runtime /home/solo/.hermes/hermes-agent/venv/bin/hermes currently does not expose ingest-pr; deployment/runtime refresh is still required before claiming webhook monitoring is live

Router baseline record: run-20260801T080505-deb06eea, blocked_baseline_failed; Orion authorized one-time DEV-direct fallback for this repair.

@solovision24
solovision24 changed the base branch from main to dev/hermes-upgrade-t_16bbffad August 1, 2026 12:57

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread hermes_cli/kanban_db.py
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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread hermes_cli/kanban_db.py Outdated
Comment on lines +3984 to +3987
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"]),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread hermes_cli/kanban.py
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")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread hermes_cli/kanban_db.py Outdated
Comment on lines +3982 to +3984
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:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@solovision24

Copy link
Copy Markdown
Owner Author

Orion Review — changes required

Reviewed immutable head abafe6ab2cdc59bb42214f3e036819164a3068fe. I retargeted the PR from stale main to its actual installed baseline, dev/hermes-upgrade-t_16bbffad; the live PR is now a clean 3-file diff.

P1 — same-head webhook replay can orphan/duplicate an active review

hermes_cli/kanban_db.py:3977-3989 updates a same-head card's status and clears claim_lock / worker_pid whenever checks or mergeability are supplied. If the card is already running, a check-suite webhook can move it back to review while leaving current_run_id behind. That breaks truthful ownership and can dispatch a second Orion reviewer for the same head.

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 dd8ab593c.

P1 — this is not the canonical upstream-aligned lifecycle

hermes_cli/kanban_db.py:3949-3997 is a simplified exact-key upsert. Compared with the canonical implementation in dd8ab593c, it drops:

  • one-active-head supersession/archival;
  • harmless no-op handling for unseen/replayed terminal events;
  • reopening of the canonical archived same-head card;
  • canonical assignee normalization;
  • exact duplicate no-op semantics;
  • untrusted GitHub PR data fencing.

The current code also creates a new done card for an unseen close/merge and leaves an old head active when a new head arrives. That violates the requested create/update lifecycle and can leave stale Review work dispatchable.

Acceptance: port the full canonical ingest_pull_request behavior from dd8ab593c onto the current baseline, adapting only where current APIs require it.

P1 — required regression coverage was reduced

Only four ingest tests were added to tests/hermes_cli/test_kanban_cli.py. The prior canonical suite covered new-head supersession, active-claim preservation, canonical event/identity fields, unseen terminal no-op, blocked→review promotion, and same-head reopen. Those are exactly the contracts the simplified implementation regressed.

Acceptance: restore the focused CLI + DB tests from dd8ab593c, including draft/conflict routing and active-review preservation. Keep an isolated end-to-end adapter smoke. I independently ran the current focused suite (7/7) and a safely isolated synthetic adapter smoke (one status=review card), but passing happy-path smoke does not cover the lifecycle regressions above.

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.

@solovision24
solovision24 merged commit b4d2878 into dev/hermes-upgrade-t_16bbffad Aug 2, 2026
35 of 37 checks passed
solovision24 added a commit that referenced this pull request Aug 2, 2026
* 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>
solovision24 added a commit that referenced this pull request Aug 2, 2026
* fix(kanban): restore native GitHub PR ingest

* fix(kanban): restore GitHub PR lifecycle safeguards

---------

Co-authored-by: SoLo <solo@SoLoBot>
solovision24 pushed a commit that referenced this pull request Aug 3, 2026
…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.
solovision24 pushed a commit that referenced this pull request Aug 18, 2026
docs(relay): explain canonical operation migration
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