Add metadata to Slack notifications - #6675
Open
suhaibmujahid wants to merge 2 commits into
Open
Conversation
Enhances Slack `chat_postMessage` calls to include structured message metadata for notification events. The metadata now carries run traceability details (`run_id`, agent name, and a direct Hackbot UI run URL), improving downstream context and linkage.
suhaibmujahid
force-pushed
the
slack-metadata
branch
from
August 20, 2026 01:58
5f39f02 to
87ab350
Compare
There was a problem hiding this comment.
Pull request overview
Adds structured Slack message metadata to chat_postMessage calls so notification messages can be traced back to a specific Hackbot run (run id, agent, and a UI deep link), aligning with Issue #6671’s goal of making sent messages easier to interact with downstream.
Changes:
- Add a
metadatapayload to Slackchat_postMessagecalls in the apply-side Slack handler. - Update the Slack handler unit test to assert the new request payload (including metadata).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| libs/hackbot-runtime/hackbot_runtime/actions/handlers/slack_handler.py | Adds Slack metadata to outgoing chat_postMessage requests for run traceability. |
| libs/hackbot-runtime/tests/test_slack_handler.py | Updates assertions to expect the new Slack request shape including metadata. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+55
to
+64
| "metadata": { | ||
| "event_type": "notification", | ||
| "source": { | ||
| "ref_id": "run-1", | ||
| "ref_url": f"{HACKBOT_UI_URL}/runs/run-1", | ||
| }, | ||
| "event_payload": { | ||
| "context": {"agent": "test-agent", "run_id": "run-1"}, | ||
| }, | ||
| }, |
Comment on lines
+40
to
+52
| metadata = { | ||
| "event_type": "notification", | ||
| "source": { | ||
| "ref_id": ctx.run_id, | ||
| "ref_url": f"{HACKBOT_UI_URL}/runs/{ctx.run_id}", | ||
| }, | ||
| "event_payload": { | ||
| "context": { | ||
| "agent": ctx.agent, | ||
| "run_id": ctx.run_id, | ||
| }, | ||
| }, | ||
| } |
evgenyrp
approved these changes
Aug 20, 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.
Resolves #6671
Enhances Slack
chat_postMessagecalls to include structured message metadata for notification events. The metadata now carries run traceability details (run_id, agent name, and a direct Hackbot UI run URL), improving downstream context and linkage.Stack created with GitHub Stacks CLI • Give Feedback 💬