Skip to content

fix(slack): thread agent identity through channel reply path#27134

Merged
Takhoffman merged 5 commits intoopenclaw:mainfrom
hou-rong:fix/slack-reply-identity
Mar 1, 2026
Merged

fix(slack): thread agent identity through channel reply path#27134
Takhoffman merged 5 commits intoopenclaw:mainfrom
hou-rong:fix/slack-reply-identity

Conversation

@hou-rong
Copy link
Copy Markdown
Contributor

@hou-rong hou-rong commented Feb 26, 2026

Summary

Thread agent outbound identity (chat:write.customize overrides) through the Slack channel reply delivery path so per-agent username, icon URL, and icon emoji are applied to all Slack replies including media messages.

Fixes #27080

Problem

When an agent has outbound.identity configured (name, avatarUrl, emoji), the Slack monitor reply path (deliverReplies) ignores it. All replies appear as the default bot identity, even though sendMessageSlack already supports an identity parameter via chat:write.customize.

Solution

  • Add optional identity?: SlackSendIdentity param to deliverReplies() in src/slack/monitor/replies.ts
  • Pass identity through to both text-only and media sendMessageSlack calls
  • In dispatch.ts, resolve the agent's outbound identity via resolveAgentOutboundIdentity() and convert to SlackSendIdentity format
  • Pass the resolved identity to deliverNormally()deliverReplies()

Test plan

  • Added src/slack/monitor/replies.test.ts with 3 tests:
    • Verifies identity object is passed to sendMessageSlack for text replies
    • Verifies identity object is passed to sendMessageSlack for media replies
    • Verifies identity key is omitted when no identity is provided
  • pnpm test src/slack/monitor/replies.test.ts — all 3 tests pass

Changelog

Added entry under ### Fixes in CHANGELOG.md.

@openclaw-barnacle openclaw-barnacle bot added channel: slack Channel integration: slack size: XS labels Feb 26, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Feb 26, 2026

Greptile Summary

Added agent identity customization support to the Slack channel reply path, allowing multi-agent setups to display distinct usernames and avatars when posting replies. The implementation correctly threads the agent's outbound.identity configuration through deliverReplies()sendMessageSlack() by:

  • Resolving agent identity via resolveAgentOutboundIdentity() in dispatch.ts
  • Mapping OutboundIdentity format to Slack's SlackSendIdentity format (name→username, avatarUrl→iconUrl, emoji→iconEmoji)
  • Passing identity through to both text-only and media reply paths
  • Using conditional spread syntax to avoid passing undefined values

The changes are minimal, focused, and properly typed. Identity support is correctly implemented for the standard reply path that uses chat.postMessage with the chat:write.customize scope.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation is straightforward and correct: it properly resolves agent identity, maps types correctly, and threads the identity parameter through all necessary code paths. The changes are minimal (2 files, ~15 lines), well-scoped, and use existing infrastructure (resolveAgentOutboundIdentity, sendMessageSlack already supports identity). Type mappings are accurate, and conditional spread syntax prevents passing undefined. No breaking changes or risky operations.
  • No files require special attention

Last reviewed commit: 6a18aa4

@hou-rong
Copy link
Copy Markdown
Contributor Author

Fixed the oxfmt import ordering issue — CI should be green on the next run.

This threads the agent's outbound.identity config through the Slack monitor reply path so multi-agent setups can post with distinct display names/avatars via chat:write.customize. Ready for review.

@hou-rong
Copy link
Copy Markdown
Contributor Author

Ping for review — CI green (Windows test failure is the known session.test.ts path issue, same as merged #27140). Ready to go whenever you have a moment.

@hou-rong hou-rong changed the title Slack: thread agent identity through channel reply path fix(slack): thread agent identity through channel reply path Feb 28, 2026
@hou-rong
Copy link
Copy Markdown
Contributor Author

Friendly ping — CI is all green now (including the TypeScript fix for the test mock). This PR adds tests, changelog entry, and follows conventional commit format. Ready for review when you have a moment. Thanks!

@hou-rong hou-rong force-pushed the fix/slack-reply-identity branch from ac815c2 to d33ff59 Compare February 28, 2026 13:12
hou-rong and others added 5 commits March 1, 2026 09:04
sendMessageSlack() correctly accepts opts.identity for
chat:write.customize overrides, but the inbound channel reply path
(deliverReplies) never passed it. Resolve the agent's outbound
identity from config and forward it so replies display the configured
name/avatar instead of the default bot profile.

Closes openclaw#27080

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add unit tests verifying agent identity (username, icon URL, emoji)
is correctly threaded through deliverReplies to sendMessageSlack
for both text and media replies.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Provide required log/error/exit stubs so tsgo passes.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@Takhoffman Takhoffman force-pushed the fix/slack-reply-identity branch from d33ff59 to 2dc7a4b Compare March 1, 2026 15:25
@Takhoffman Takhoffman merged commit b3f60a6 into openclaw:main Mar 1, 2026
9 checks passed
@Takhoffman
Copy link
Copy Markdown
Contributor

PR #27134 - fix(slack): thread agent identity through channel reply path (#27134)

Merged via squash.

  • Merge commit: b3f60a6
  • Verified: pnpm install --frozen-lockfile, pnpm build, pnpm check, pnpm test:macmini
  • Changes made:
    M\textensions/slack/src/channel.test.ts
  • Why these changes were made:
    Rebase onto latest main surfaced a typecheck regression in the Slack extension tests because buildAccountSnapshot now expects cfg and may return asynchronously; the test was updated to pass cfg and await the snapshot.
  • Changelog: CHANGELOG.md updated=true required=true opt_out=false

Thanks @hou-rong!

zooqueen added a commit to hanzoai/bot that referenced this pull request Mar 1, 2026
ansh pushed a commit to vibecode/openclaw that referenced this pull request Mar 2, 2026
…w#27134) thanks @hou-rong

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: hou-rong <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
steipete pushed a commit to Sid-Qin/openclaw that referenced this pull request Mar 2, 2026
…w#27134) thanks @hou-rong

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: hou-rong <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
safzanpirani pushed a commit to safzanpirani/clawdbot that referenced this pull request Mar 2, 2026
…w#27134) thanks @hou-rong

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: hou-rong <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
steipete pushed a commit to Sid-Qin/openclaw that referenced this pull request Mar 2, 2026
…w#27134) thanks @hou-rong

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: hou-rong <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
robertchang-ga pushed a commit to robertchang-ga/openclaw that referenced this pull request Mar 2, 2026
…w#27134) thanks @hou-rong

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: hou-rong <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
hanqizheng pushed a commit to hanqizheng/openclaw that referenced this pull request Mar 2, 2026
…w#27134) thanks @hou-rong

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: hou-rong <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
execute008 pushed a commit to execute008/openclaw that referenced this pull request Mar 2, 2026
…w#27134) thanks @hou-rong

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: hou-rong <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
dorgonman pushed a commit to kanohorizonia/openclaw that referenced this pull request Mar 3, 2026
…w#27134) thanks @hou-rong

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: hou-rong <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
sachinkundu pushed a commit to sachinkundu/openclaw that referenced this pull request Mar 6, 2026
…w#27134) thanks @hou-rong

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: hou-rong <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…w#27134) thanks @hou-rong

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: hou-rong <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
zooqueen added a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
Mateljan1 pushed a commit to Mateljan1/openclaw that referenced this pull request Mar 7, 2026
…w#27134) thanks @hou-rong

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: hou-rong <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
alexey-pelykh pushed a commit to remoteclaw/remoteclaw that referenced this pull request Mar 15, 2026
…w#27134) thanks @hou-rong

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: hou-rong <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
(cherry picked from commit b3f60a6)
alexey-pelykh added a commit to remoteclaw/remoteclaw that referenced this pull request Mar 15, 2026
…w#27134) thanks @hou-rong (#1415)

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini



(cherry picked from commit b3f60a6)

Co-authored-by: HouRong <[email protected]>
Co-authored-by: hou-rong <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: slack Channel integration: slack size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Slack channel replies ignore agent identity (name/avatar) — chat:write.customize never applied

2 participants