Skip to content

Add metadata to Slack notifications - #6675

Open
suhaibmujahid wants to merge 2 commits into
slack-webhookfrom
slack-metadata
Open

Add metadata to Slack notifications#6675
suhaibmujahid wants to merge 2 commits into
slack-webhookfrom
slack-metadata

Conversation

@suhaibmujahid

Copy link
Copy Markdown
Member

Resolves #6671

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.


Stack created with GitHub Stacks CLIGive Feedback 💬

@suhaibmujahid
suhaibmujahid requested a review from a team as a code owner August 20, 2026 01:49
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.
Copilot AI lite review requested due to automatic review settings August 20, 2026 02:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 metadata payload to Slack chat_postMessage calls 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,
},
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants