fix(kanban): preserve native card during webhook convergence - #16
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f80c96a3c7
ℹ️ 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".
| _merge_task_history( | ||
| conn, | ||
| str(duplicate["id"]), | ||
| canonical_id, |
There was a problem hiding this comment.
Clear the archived webhook card's idempotency key
When the webhook card arrived first, this fold archives it but leaves its github-pr:... idempotency key intact before assigning that same key to the native card. On the next webhook replay, ingest_pull_request() orders matching rows oldest-first, selects the archived webhook row as same_head, archives the active native card as superseded, and creates a third card even though the SHA is unchanged. Clear the source key during reconciliation or make ingestion prefer the active same-head row so webhook retries do not undo native-card preservation.
AGENTS.md reference: AGENTS.md:L54-L57
Useful? React with 👍 / 👎.
| conn, | ||
| str(duplicate["id"]), | ||
| canonical_id, | ||
| source_run_id=None, |
There was a problem hiding this comment.
Terminate an in-flight webhook review run before folding
When the webhook-created card has already been claimed by a reviewer, passing source_run_id=None migrates that run onto the native task without ending it. The native implementation run is then ended and current_run_id cleared, leaving an unreferenced task_runs row with status='running', its claim lock, and no ended_at; meanwhile the existing reviewer worker still targets the now-archived webhook task and cannot complete its review. Reconciliation must explicitly close or otherwise safely transfer the duplicate card's active run.
AGENTS.md reference: AGENTS.md:L54-L57
Useful? React with 👍 / 👎.
Orion Review — changes requiredReviewed immutable head Blocking findings
Verification performed
Do not merge this head. Return one focused, mergeable, green immutable head on the approved fork base. |
9497754 to
cca6f8f
Compare
Orion re-review — changes requiredReviewed immutable head Blocking findings
Verification performed
Acceptance: correct the stale call-site comment, push one new immutable head on the same focused branch, and return with required checks green or with explicit proof that the repository gate has accepted/rerun the unrelated failure. |
|
ORION ACCEPTED — exact immutable head Reviewed the complete two-file diff from base |
Summary
Verification
scripts/run_tests.sh tests/hermes_cli/test_kanban_review_lifecycle.py tests/hermes_cli/test_kanban_cli.py— 30 passedscripts/run_tests.sh tests/hermes_cli/test_kanban_db.py tests/tools/test_kanban_tools.py tests/gateway/test_kanban_notifier.py tests/gateway/test_kanban_notifier_watcher_dispatch_gate.py tests/hermes_cli/test_kanban_count_notify_subs.py— 77 passedgit diff --checkandpython3 -m compileall -q hermes_cli/kanban_db.py tests/hermes_cli/test_kanban_review_lifecycle.pyKanban Task