hermes-agent/gateway
Nikita Barkov 5d3f75110a fix(kanban): key terminal-event wakes to the creator's workspace scope
Slack session keys include the workspace id since #70190, but the kanban
notifier rebuilds the wake source from a subscription row that has no scope
column, so every terminal-event wake keyed without the workspace.

The legacy-key adoption shipped in the same change (`_legacy_slack_session_key`,
`_recovered_row_matches_source_scope`) resolves that unscoped key onto the same
session_id, so the wake passes the busy guards that are keyed by routing key
(`_active_sessions`, `_running_agents`) and only collides afterwards, on session
id, under the per-session turn lease (#64934) — which serializes it behind the
live turn's flush. On a live Slack gateway that shows up as a duplicate run on
one task plus 400+s of waiting before the woken turn starts.

Same failure mode as #56580 / #72191 (chat_type), one field over, and it needs
no schema change: `_thread_metadata_for_source()` already stamps
`slack_team_id`, the notify subscription persists that dict as
`delivery_metadata`, and the notifier already unpacks it. Rows written by
`kanban_tools._maybe_auto_subscribe` carry no workspace, so fall back to the
adapter's channel → workspace map via `scope_id_for_chat()`, read with getattr
so adapters opt in and unscoped platforms' keys stay byte-identical. Slack
answers it from `_remember_channel_team`, which drops channels claimed by two
workspaces, so an unknown or ambiguous channel degrades to today's behavior
instead of guessing wrong.

Also adds the contributor email mapping the attribution check requires.

Co-authored-by: Junie <junie@jetbrains.com>
2026-08-13 11:41:19 -07:00
..
assets
…
builtin_hooks
…
platforms fix: don't double-count session-stream turns in the shutdown drain 2026-08-13 09:34:08 -07:00
relay fix(cron): relay-fronted Slack delivery — synthetic creation-thread capture + preflight fronted-platform blindness 2026-08-13 10:46:13 -07:00
__init__.py
…
agent_cache_pressure.py fix: follow-ups for salvaged PR #80795 2026-08-07 21:02:33 +05:30
authz_mixin.py fix(plugins): isolate ownership by profile 2026-08-12 19:13:32 -07:00
cgroup_cleanup.py
…
channel_directory.py fix(gateway): run channel-directory write off the event loop 2026-08-11 20:37:06 +05:30
code_skew.py
…
config.py feat(gateway): allow selective multiplex profile serving 2026-08-10 22:48:24 -07:00
cwd_placeholder.py
…
dead_targets.py
…
delivery.py
…
delivery_ledger.py
…
display_config.py
…
drain_control.py fix(gateway): expire orphaned drain markers past a max-age so a leaked marker can't wedge the gateway (#85433) 2026-08-13 23:23:48 +05:30
hooks.py fix: handle replacement transforms after CLI streaming 2026-08-08 14:06:30 +05:30
kanban_watchers.py fix(kanban): key terminal-event wakes to the creator's workspace scope 2026-08-13 11:41:19 -07:00
lifecycle_ledger.py fix(gateway): treat pid=None lifecycle sentinel as unknown ownership in mark_exited 2026-07-28 22:41:09 -07:00
memory_monitor.py
…
message_timestamps.py
…
mirror.py
…
pairing.py fix(secrets): route authz gate and pairing allowlist reads through the profile secret scope 2026-08-02 10:02:33 -07:00
platform_registry.py fix(plugins): isolate ownership by profile 2026-08-12 19:13:32 -07:00
profile_routing.py feat(gateway): allow selective multiplex profile serving 2026-08-10 22:48:24 -07:00
readiness.py
…
response_filters.py
…
restart.py fix(gateway): defer in-band restart until active turns finish (#77184) 2026-08-03 09:57:58 +05:30
restart_loop_guard.py fix(gateway): make the restart-loop breaker see slow crash cycles (#81642) 2026-08-09 21:40:23 +05:30
rich_sent_store.py
…
run.py feat(slack): render tool progress as native plan/task cards (opt-in) 2026-08-13 11:12:19 -07:00
runtime_footer.py feat(gateway): add opt-in 'latency' runtime footer field 2026-08-03 17:16:57 +05:30
scale_to_zero.py fix(gateway): scale-to-zero gateway self-suspends via flaps socket instead of relying on Fly autostop (#84295) 2026-08-12 14:45:48 +10:00
session.py fix(sessions): keep reset conversations listable 2026-08-13 23:45:21 +05:30
session_context.py feat(kanban): explicit notify/wake delivery modes with faithful wake session routing 2026-08-13 10:47:40 -07:00
session_stall.py feat(gateway): session activity watchdog, stall notify, compress timeout (#72424) 2026-08-02 16:16:36 -07:00
session_state.py refactor(gateway): extract the hygiene recovery gate and forward the failure reason 2026-08-06 15:04:53 +05:30
shutdown_flush.py fix(gateway): spool cap-dropped pending transcript messages instead of discarding 2026-08-09 14:08:51 -07:00
shutdown_forensics.py
…
shutdown_watchdog.py fix(gateway): detect and report unclean shutdowns via lifecycle ledger (NS-608) 2026-07-28 22:41:09 -07:00
slash_access.py
…
slash_commands.py feat(kanban): explicit notify/wake delivery modes with faithful wake session routing 2026-08-13 10:47:40 -07:00
status.py fix(gateway): classify terminal adapter connect failures + escalate long-lived retry loops (OOF-156) 2026-08-12 22:16:12 -07:00
status_phrases.py
…
sticker_cache.py
…
stream_consumer.py fix(gateway,relay): stop frozen-preview finals and dropped idle-session delegation callbacks (#82592) 2026-08-11 09:56:13 +10:00
stream_dispatch.py
…
stream_events.py
…
streaming_tts_consumer.py feat(gateway): streaming TTS adapter contract and consumer (#60671) 2026-07-28 22:31:40 -07:00
systemd_notify.py
…
turn_context.py feat(slack): render tool progress as native plan/task cards (opt-in) 2026-08-13 11:12:19 -07:00
turn_lease.py refactor(gateway): drop dead degraded token field; de-churn salvage diff 2026-08-07 18:23:57 +05:30
wake.py
…
whatsapp_identity.py
…