fix(kanban): dedupe kanban notifier delivery claims - #22558
Closed
quocanh261997 wants to merge 2 commits into
Closed
fix(kanban): dedupe kanban notifier delivery claims#22558quocanh261997 wants to merge 2 commits into
quocanh261997 wants to merge 2 commits into
Conversation
quocanh261997
force-pushed
the
kanban/t_4f039931-notifier-fixes
branch
from
May 9, 2026 13:07
19e0485 to
9e694e5
Compare
Contributor
|
Salvage merged via PR #23401 (rebase) — both your commits (the notifier claim/rewind work and the lint.yml fork-PR fix) shipped on Two improvements added during salvage:
The fix interlocks cleanly with PR #22994 (drop redundant Thanks @quocanh261997 — well-engineered fix with the right SQLite primitives ( |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
Fixes Kanban notification delivery races that can cause duplicate or misattributed completion/block notifications in multi-profile gateway setups.
The issue is that multiple active profile gateways can watch the same Kanban database path, sometimes through different board slugs that resolve to the same SQLite file. Without a single delivery claim, more than one gateway can observe and send the same notification event, and the message may appear to come from a profile that was not part of the original conversation.
This PR makes notification delivery safer by deduplicating board database paths per watcher tick and adding an atomic event-claim flow before delivery. If delivery fails or the platform is disconnected, the notifier rewinds so another attempt can handle the event later instead of silently losing it.
It also hardens Kanban test isolation so tests do not inherit production home-channel or Kanban configuration and accidentally write fake cards/subscriptions into a real user board.
Related Issue
No public issue filed. Follow-up from investigation of Kanban notification duplication/misattribution in a multi-profile Discord gateway setup.
Type of Change
Changes Made
gateway/run.pyhermes_cli/kanban_db.pytests/conftest.pytests/gateway/test_kanban_notifier.pytests/hermes_cli/test_kanban_core_functionality.pyHow to Test
Reproduction before this fix:
Verification for this branch:
Run the focused notifier and Kanban tests with an isolated Hermes home:
HERMES_HOME=$(mktemp -d) HOME=/home/mike python -m pytest \ tests/gateway/test_kanban_notifier.py \ tests/hermes_cli/test_kanban_core_functionality.py \ -qConfirm the result:
Carl also ran these focused checks before handoff:
Platforms tested:
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
Focused test output from this branch: