← Back to PRs

#14912: fix(slack): enable session-store lookup for announce target accountId

by mcaxtr open 2026-02-12 19:20 View on GitHub →
channel: slack agents size: S trusted-contributor experienced-contributor
## Summary Fixes #14854 - Adds `preferSessionLookupForAnnounceTarget: true` to the Slack channel plugin meta, matching the existing WhatsApp pattern - Without this flag, `resolveAnnounceTarget()` returns immediately from the key-parsed fallback path — which never carries `accountId` — so Slack announce messages lose their account context in multi-account setups ## Test plan - [x] Add Slack plugin stub with `preferSessionLookupForAnnounceTarget: true` to test registry - [x] Add test verifying `resolveAnnounceTarget()` hydrates `accountId` from `sessions.list` for Slack sessions - [x] All 3 tests pass after fix; new test fails without the flag (returns fallback with no `accountId`) - [x] `pnpm build && pnpm check` pass <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR enables `preferSessionLookupForAnnounceTarget: true` on the Slack channel plugin metadata and adds a focused regression test. In the current `resolveAnnounceTarget()` implementation (`src/agents/tools/sessions-announce-target.ts`), plugins without this flag return a target derived from the session key/display key immediately. That parsed fallback does not include `accountId`, so Slack announce messages can lose account context in multi-account setups. With the flag enabled, `resolveAnnounceTarget()` performs a `sessions.list` lookup and hydrates `accountId` from the session’s `deliveryContext` when available (mirroring the existing WhatsApp behavior). <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk. - The change is a single metadata flag addition plus a regression test that matches the existing WhatsApp pattern. The new test exercises the intended `sessions.list` hydration path and does not alter core resolution logic. - No files require special attention <sub>Last reviewed commit: 58003ad</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs