Skip to content

fix(gateway): add chat_id to hook_ctx for message source tracking#23463

Closed
diablozzc wants to merge 1 commit into
NousResearch:mainfrom
diablozzc:add-chat-id-to-hook-ctx
Closed

fix(gateway): add chat_id to hook_ctx for message source tracking#23463
diablozzc wants to merge 1 commit into
NousResearch:mainfrom
diablozzc:add-chat-id-to-hook-ctx

Conversation

@diablozzc

Copy link
Copy Markdown
Contributor

Summary

Adds chat_id to the hook_ctx dictionary passed to gateway hooks, enabling hook implementations to identify the target chat of a message source.

Change

gateway/run.py: One line addition in hook_ctx:

+ "chat_id": source.chat_id or "",

Motivation

Hook extensions currently lack chat_id visibility, making it impossible to route or filter hook logic based on the target chat. This change surfaces that field without breaking existing consumers (falls back to empty string if chat_id is None).

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery comp/plugins Plugin system and bundled plugins labels May 11, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #24710 (cherry-picked onto current main with your authorship preserved). Thanks for the contribution!

@teknium1 teknium1 closed this May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants