fix(slack): conversation lookups no longer grow cache without bound#101562
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 7, 2026, 6:37 AM ET / 10:37 UTC. Summary PR surface: Source +25, Tests +49. Total +74 across 2 files. Reproducibility: yes. Source inspection of current main shows every resolved Slack account/channel key is retained in an unbounded module Map; the PR body also includes a red regression test for eviction before the fix. Review metrics: none identified. Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Next step before merge
Security Review detailsBest possible solution: Land a bounded process-local Slack conversation-info cache that preserves resolver semantics and recomputes evicted entries through the existing Slack-owned lookup path. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection of current main shows every resolved Slack account/channel key is retained in an unbounded module Map; the PR body also includes a red regression test for eviction before the fix. Is this the best way to solve the issue? Yes. The fix stays inside the Slack-owned helper, follows existing bounded Map cache patterns, preserves config/API/persisted-state behavior, and adds focused regression coverage for the new invariant. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 942b44966107. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +25, Tests +49. Total +74 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
56aa859 to
0b364df
Compare
0b364df to
9fe0d98
Compare
|
Land-ready maintainer repair completed. The contributor fix now reuses the shared pruneMapToMaxSize helper while preserving LRU hit promotion and the 1024-entry bound. Focused Slack proof passed 7/7 tests; formatting and diff checks passed; exact repaired content passed check:changed on Testbox-through-Crabbox tbx_01kwy9f5yj11g6md3fwxvpv3yr; fresh autoreview reported no actionable findings at 0.91 confidence; exact-head CI run 28867053630 completed successfully with zero failures. Repaired head: 9fe0d98. |
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where long-running Slack channel workers could keep every distinct conversation-info lookup in process memory indefinitely when many workspaces or channel IDs are resolved over time.
No linked issue. I checked the latest
origin/mainbefore the change and the Slack conversation-info cache was still an unboundedMap. I also searched open PRs for the exact cache symbol, the Slack channel-type path,slack cache, andslack conversation; I did not find an open PR handling this cache growth.Why This Change Was Made
The Slack conversation-info cache now has a 1024-entry LRU limit. Cache hits are promoted, every cache write goes through the bounded helper, and the oldest non-promoted entry is evicted before inserting a new distinct account/channel key beyond the limit.
This does not change Slack config, schema, persisted state, Slack API request shape, or channel classification rules; it only bounds the process-local metadata cache.
User Impact
Long-running Slack deployments can continue resolving many channels without unbounded process-local memory growth from conversation metadata. Recently used conversation info remains cached, while stale entries are eligible for recomputation.
Evidence
RED regression proof before the fix:
Focused regression test after the fix:
Issue-path runtime proof using the real Slack conversation resolver without Slack client mocks:
Static checks:
OpenClaw gateway startup smoke after the patch: