Skip to content

test(slack): add peer-agent smoke target - #51637

Closed
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix/51630-slack-peer-smoke
Closed

test(slack): add peer-agent smoke target#51637
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix/51630-slack-peer-smoke

Conversation

@LeonSGP43

Copy link
Copy Markdown
Contributor

Summary

  • add a dedicated synthetic Slack peer-agent smoke target for strict mention + allow_bots=mentions deployments
  • cover the live-routing invariants for human mentions, peer-bot mention gating, and passive ack/status/error suppression
  • document the single post-deploy pytest command and failure buckets in the Slack messaging guide

Testing

  • uv run --frozen pytest -q tests/gateway/test_slack_peer_agent_smoke.py -o addopts=''
  • uv run --frozen ruff check tests/gateway/test_slack_peer_agent_smoke.py
  • git diff --check

Closes #51630.

@alt-glitch alt-glitch added type/test Test coverage or test infrastructure comp/gateway Gateway runner, session dispatch, delivery platform/slack Slack app adapter P3 Low — cosmetic, nice to have labels Jun 24, 2026

@tonydwb tonydwb 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.

Code Review Summary

Verdict: Approved

Well-structured addition of a repeatable smoke test for Slack peer-agent routing invariants. Key positives:

  • Uses synthetic in-process Slack events (no live messages or real tokens needed)
  • Thorough preflight contract check covering config, connectivity, and bot identity
  • Tests all critical routing paths: human mention routing, peer-bot ignore without mention, explicit peer-bot mention routing, passive ack/status/error suppression
  • Good documentation of failure buckets in the companion docs update
  • Clean mock setup with _ensure_slack_mock() for environments without slack_bolt installed

No security concerns. The test file is self-contained and well-documented.


Reviewed by Hermes Agent

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for adding a focused synthetic routing target and documenting an operator command.

Problems

  • tests/gateway/test_slack_peer_agent_smoke.py:91 creates the passing configuration, mocked client, and bot identity before _assert_peer_agent_preflight() runs. The preflight cannot therefore produce the config, connectivity, or bot-identity failures that website/docs/user-guide/messaging/slack.md:409 presents as post-deploy checks.
  • tests/gateway/test_slack_peer_agent_smoke.py:163 supplies bot_id for peer events. Current main already recognizes that shape at plugins/platforms/slack/adapter.py:2600; this does not cover the ordinary bot-user event shape discussed in linked PR #51627.

Suggested changes

  • Either describe this as a deterministic adapter regression test, or add a path that inspects effective runtime configuration and identity state.
  • Add the no-bot_id/no-subtype peer bot-user event shape if this target is intended to cover the peer-routing incident class.

Automated hermes-sweeper review.

text="status: work finished",
user=PEER_USER_ID,
bot_id="B_PEER",
ts=REPLY_TS,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This only exercises the already-recognized bot_id event shape. Please add the ordinary peer bot-user event shape (a user ID without bot_id or subtype) if this smoke target is meant to cover the routing incident described by #51627.

allowed_channels: ""
```

After gateway config changes, deploys, or restarts, run this synthetic smoke target:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The target constructs its own passing config, mocked client, and bot identity, so it cannot validate a deployed gateway after a restart or distinguish those runtime failure buckets. Please either narrow this wording to an adapter regression test or add a runtime-aware check.

@teknium1 teknium1 added the sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users label Jul 15, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Merged via #69483 — your commit was cherry-picked/reapplied onto current main with your authorship preserved in git history: your peer-agent smoke test was cherry-picked clean, fixes #51630.

Thanks for the contribution!

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 P3 Low — cosmetic, nice to have platform/slack Slack app adapter sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users type/test Test coverage or test infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add repeatable Slack peer-agent routing smoke test

4 participants