#23056: fix(slack): exclude archived channels from startup channel resolution
channel: slack
size: XS
Cluster:
Slack Integration Improvements
## Summary
`listSlackChannels()` in `resolve-channels.ts` calls `conversations.list` with `exclude_archived: false`, which paginates through **every** channel in the workspace including archived ones.
For workspaces with thousands of archived channels (e.g., a 10-year-old Slack install), this:
- Burns through Slack's rate limit on every gateway startup
- Causes `rate_limit_exceeded` warnings with 30-second retry delays
- Compounds when the gateway restarts multiple times (each restart re-fetches the full list)
## Fix
One-line change: `exclude_archived: false` → `exclude_archived: true`
This is safe because `resolveByName()` already prefers active channels over archived ones (line 89), and channels referenced by ID don't need the list at all — they're matched directly.
Supersedes #19870 (closed due to stale branch).
## Test plan
- [x] Verified channel resolution still works when channels are referenced by ID (e.g., `C02LFRN0V`)
- [ ] CI passes
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Changed `exclude_archived` from `false` to `true` in `listSlackChannels()` to prevent fetching thousands of archived channels during gateway startup, avoiding Slack API rate limits.
- Resolves rate limit warnings for workspaces with large numbers of archived channels
- Name-based resolution already prefers active channels (resolve-channels.ts:89)
- ID-based channel references continue to work (resolved as `true` even if channel metadata is missing from the list)
- The `archived` field is only used for logging, so missing metadata for archived channels referenced by ID has no functional impact
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- Simple one-line fix that addresses a real performance issue without breaking existing functionality. The change is well-justified and the code already handles the edge case where archived channels might be referenced by ID
- No files require special attention
<sub>Last reviewed commit: 7c4858b</sub>
<!-- greptile_other_comments_section -->
<sub>(5/5) You can turn off certain types of comments like style [here](https://app.greptile.com/review/github)!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#8024: fix(slack): resolve channel names via directory for cross-account m...
by emma-digital-assistant · 2026-02-03
79.3%
#5312: fix(slack): skip users.list API call when all user entries are IDs
by gunpyo-park-musinsa · 2026-01-31
78.7%
#12954: feat(slack): Add channel name resolution with TTL cache
by trevorgordon981 · 2026-02-10
77.6%
#7592: fix(slack): prevent unbounded memory growth in channel type cache
by namratabhaumik · 2026-02-03
77.3%
#8684: fix(slack): add title param and channel resolution for file upload
by shuans · 2026-02-04
76.9%
#20479: fix(slack): keep replies flowing for oversized file uploads
by olyashok · 2026-02-19
76.0%
#23320: fix(slack): respect replyToMode when incomingThreadTs is auto-created
by dorukardahan · 2026-02-22
74.8%
#23513: fix(slack): respect replyToMode=off for inline directive reply tags
by dorukardahan · 2026-02-22
74.2%
#12414: fix(slack): do not cache API failures in thread_ts resolver
by Yida-Dev · 2026-02-09
74.1%
#5036: docs: improve Slack setup and troubleshooting guide
by DanBatten · 2026-01-31
74.0%