fix(kanban): profile-correct notification ownership and routing (salvage #57995, #56589, #62380, #69181) - #72241
Merged
Merged
Conversation
Contributor
૮ >ﻌ< ა ci reviewran on 47597e9 ℹ️ InfoDesktop E2E visual evidence · View test artifacts · View job1 visual diff. inline evidence upload failed. Failed to upload diff-665a0833239e-onboarding-overlay-diff.png with gh image (exit code 1): Error uploading /home/runner/work/_temp/e2e-evidence/diff-665a0833239e-onboarding-overlay-diff.png: step 0 (get upload token): uploadToken not found on repo page — do you have write access to NousResearch/hermes-agent? (or, if NousResearch enforces SAML SSO, authorize at https://github.com/orgs/NousResearch/sso) |
teknium1
force-pushed
the
pr/kanban-profile-ownership
branch
from
July 26, 2026 23:05
806780b to
1957733
Compare
_collect()'s active_platforms pre-filter was derived solely from self.adapters (the default profile), so a subscription owned by a secondary profile on a platform the default profile never connected (e.g. beta owns discord, default has no discord adapter at all) was skipped before claim_unseen_events_for_sub ever ran. Unlike the disconnected-adapter path, an unclaimed event is never rewound, so this was a permanent, silent notification/wake loss — directly contradicting the point of routing notifications via the owning profile (c696430/b225b30d0). Same cross-profile-adapter-lookup bug class the delivery-side _authorization_adapter chokepoint already guards against, one gate earlier. The precise per-profile check still runs unchanged at delivery time, with its existing rewind-on-None safety net.
A gateway running under a named active profile (e.g. `hermes -p main gateway`) stamps kanban auto-subscriptions with notifier_profile=main, but _authorization_adapter() treated any name other than the literal "default" as a multiplex secondary and consulted only _profile_adapters — empty on standalone gateway-per-profile deployments. The helper failed closed, the notifier rewound the claim, and the notification was silently retried forever (#71340). Recognize the gateway's own active profile name as primary so its stamped subscriptions resolve via self.adapters; genuinely secondary profiles keep the fail-closed lookup. Salvaged from PR #62380 (the unrelated blocked-reason truncation change is intentionally not taken).
A long-lived gateway can have platform routing (HERMES_SESSION_* / HERMES_CRON_AUTO_DELIVER_*) mirrored in os.environ from a previous turn. _default_spawn() copied that process environment verbatim into detached kanban workers, so a worker calling kanban_create treated the inherited chat/topic as its origin and auto-subscribed the child task — the task's terminal notification then woke an unrelated chat. Strip every registered session-context routing key from the worker env unconditionally (the dispatcher is detached from every conversation); board, workspace, task, branch, profile, model, and credential propagation are unchanged. Salvaged from PR #69181 (both commits squashed; the PR's second commit fixed the first's engagement-latch assumption).
teknium1
force-pushed
the
pr/kanban-profile-ownership
branch
from
July 26, 2026 23:16
1957733 to
47597e9
Compare
This was referenced Jul 26, 2026
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.
Summary
Multi-profile kanban notifications now route to the profile that created them — never a wrong bot, never a silent rewind loop. Four composed contributor fixes (one commit each, authorship preserved) close the ownership gaps on the shared board: subscriptions always get an owner stamp, the notifier no longer silently loses secondary-profile events, gateway-per-profile deployments resolve their own adapter instead of failing closed forever, and dispatched workers can't inherit stale session routing.
Fixes #57993, #71340, #70179. Partially addresses #56802 (items 2–3; item 1 — decoupling the notifier from
kanban.dispatch_in_gateway— stays open as a design decision).Changes
fix: scope kanban auto-subscriptions to active profile— @tymrtn (fix: scope kanban auto-subscriptions to active profile #57995):_maybe_auto_subscribestampsnotifier_profileviaget_active_profile_name()fallback, so a sub is never ownerlessfix(kanban): widen notifier pre-filter to secondary-profile platforms— @srojk34 (fix(kanban): widen notifier pre-filter to secondary-profile platforms #56589):_collect()no longer skips (and permanently loses — cursor claimed, no rewind) events for subs owned by profiles whose platform isn't in the primary adapter mapfix(kanban): route active named profile through the active adapter map— @salimhamed (fix(kanban): deliver actionable active-profile notifications #62380, routing half):_authorization_adapterrecognizes the gateway's own active named profile as primary — kills the Kanban notify: a subscription withnotifier_profileset is never delivered when each profile runs its own gateway process (authorization chokepoint fails closed → silent rewind loop) #71340 rewind-forever loop on per-profile gateway deployments. (The PR's unrelated 160→3000-char reason-truncation change was deliberately not taken)fix(kanban): strip stale session routing from dispatched worker env— @trymhaak (fix(kanban): prevent worker session routing leaks #69181): dispatched workers no longer inheritHERMES_SESSION_*/cron routing keys, closing the cross-profile auto-subscribe leak (Kanban auto-subscribe can leak notifications across profiles #57993's mechanism). Original commits were authored as a placeholder identity; reapplied with the contributor's real handleNot taken, for the record: #70091's
dispatch_in_gatewaygate removal (would resurrect the N-gateway SQLite contention the gate prevents; its other goals are covered here or already on main), #66703 and #69020 (separate design decisions, left open).One noted edge for maintainer judgment: an explicit
profile="default"stamp on a named-primary gateway still resolves viaself.adapters— changing that would break every legacy default-stamped row, so it's left as-is.Validation
git diff --checkInfographic