Teknium
533e541237
fix(slack): bound remaining per-message/per-user tracking structures with oldest-first eviction
...
Widening pass over the whole adapter following the cluster-C16 audit
(#51019 , #51097 , #23676 , #23375 ): every in-memory structure that
accumulates per-message, per-user, or per-thread state is now bounded,
and every eviction is oldest-first — never arbitrary set-iteration
order, which is the #51019 failure mode (bot silently going quiet on
the most ACTIVE thread because set.pop-order eviction removed it).
Newly bounded:
- _approval_resolved / _clarify_resolved (caps 1000): unclicked
approval/clarify prompts leaked their double-click-guard entries
forever; oldest-insertion eviction via _trim_oldest_dict_entries.
- _reacting_message_ids (cap 5000): reaction lifecycle entries leaked
when an exception fired between add and finalize; oldest-ts eviction.
- _active_status_threads (cap 1000): statuses abandoned by error paths
accumulated; oldest-thread-ts eviction so the newest live status is
never cleared.
- _channel_team (cap 10000): grew with every DM channel the bot ever
saw (DM channel IDs are per-user). All four write sites now route
through _remember_channel_team; eviction is safe because entries are
re-learned from the next event and _get_client falls back to the
primary client.
- _slash_command_contexts (cap 1000): TTL cleanup only ran on lookup,
so contexts whose ephemeral replies never happened accumulated;
overflow purges expired entries first, then oldest-stash-first.
Converted from arbitrary set-order eviction to oldest-first:
- _titled_assistant_threads: keys are (team, channel, thread_ts) —
now evicts oldest thread first via _discard_oldest_by_thread_ts.
- _thread_rehydration_checked: keys are team:channel:thread_ts[:user] —
arbitrary eviction here would re-run an ACTIVE thread's restart
rehydration check and re-inject the missed-delta context; now evicts
oldest thread first.
- _reacting_message_ids uses #51097 's _discard_oldest_slack_timestamps.
Deliberately NOT bounded (naturally tiny, per-workspace):
_team_clients, _team_bot_user_ids, _team_bot_names (one entry per
installed workspace), _assistant_threads / _agent_view_contexts /
_bot_message_ts / _mentioned_threads / _user_name_cache /
_thread_context_cache (already bounded), _dedup (MessageDeduplicator
has max_size + TTL internally).
New helpers: _trim_oldest_dict_entries (dicts preserve insertion
order, so oldest-first is exact) and _discard_oldest_by_thread_ts
(chronological sort on the embedded Slack ts for keyed sets).
Tests: caps hold under churn, eviction removes OLDEST not arbitrary
entries, newest/active entries survive eviction pressure (regression
shape for #51019 ), plus end-to-end paths through _resolve_user_name
and _handle_slash_command.
Part of the C16 cache-bounds consolidation with #51097 (markoub),
#23676 and #23375 (EloquentBrush). Fixes #51019 .
2026-07-22 20:59:12 -07:00
..
2026-05-20 13:00:57 -07:00
2026-07-23 13:57:57 +10:00
2026-07-10 19:28:03 +05:30
2026-06-20 10:26:45 -07:00
2026-07-13 23:26:10 +05:30
2026-05-28 22:26:25 -07:00
2026-07-19 03:49:29 -07:00
2026-06-28 02:41:36 -07:00
2026-07-20 02:22:22 -07:00
2026-07-16 04:43:45 -07:00
2026-06-25 00:27:22 +05:30
2026-06-26 00:11:17 +05:30
2026-07-19 03:49:29 -07:00
2026-06-28 02:41:36 -07:00
2026-07-16 04:26:06 -07:00
2026-06-25 21:29:57 -07:00
2026-07-09 19:09:38 -07:00
2026-07-20 13:04:12 -07:00
2026-07-05 14:48:28 -07:00
2026-06-20 10:26:45 -07:00
2026-07-13 23:26:10 +05:30
2026-07-16 06:29:09 -07:00
2026-07-13 23:26:10 +05:30
2026-07-03 03:27:47 -07:00
2026-07-16 07:17:55 -07:00
2026-06-14 03:25:49 -07:00
2026-07-13 04:31:55 -07:00
2026-07-02 13:25:25 +05:30
2026-07-22 06:56:32 -07:00
2026-07-13 04:31:55 -07:00
2026-07-14 16:58:47 +05:30
2026-07-22 06:56:08 -07:00
2026-07-18 00:05:25 -07:00
2026-06-29 15:51:57 -07:00
2026-07-10 12:38:48 +05:30
2026-05-28 22:26:25 -07:00
2026-07-11 05:41:58 -07:00
2026-06-07 18:05:58 -07:00
2026-07-20 13:04:12 -07:00
2026-05-28 22:26:25 -07:00
2026-07-14 13:58:36 -07:00
2026-07-01 00:42:56 -07:00
2026-07-18 20:01:55 +05:30
2026-07-22 12:10:58 -05:00
2026-05-28 22:26:25 -07:00
2026-06-19 06:31:13 -07:00
2026-06-25 21:29:57 -07:00
2026-06-28 02:05:50 -07:00
2026-07-07 17:04:32 -07:00
2026-07-09 06:27:04 -07:00
2026-07-02 03:08:11 -07:00
2026-07-20 13:04:12 -07:00
2026-07-20 03:27:22 -07:00
2026-07-22 07:56:47 -07:00
2026-07-14 21:31:32 -07:00
2026-07-22 07:00:47 -07:00
2026-07-22 07:00:47 -07:00
2026-07-17 04:51:39 -07:00
2026-06-25 21:29:57 -07:00
2026-07-22 06:56:08 -07:00
2026-07-22 16:59:29 -07:00
2026-06-26 00:50:40 +05:30
2026-06-26 00:50:40 +05:30
2026-07-02 05:10:31 -07:00
2026-06-25 12:56:05 -07:00
2026-07-02 12:49:42 +05:30
2026-07-14 16:56:34 +05:30
2026-07-14 16:56:34 +05:30
2026-06-07 22:39:51 -07:00
2026-07-04 13:28:47 -07:00
2026-07-01 03:56:28 -07:00
2026-06-30 15:03:25 -07:00
2026-07-22 03:20:35 -07:00
2026-07-22 11:19:37 +05:30
2026-07-19 03:49:29 -07:00
2026-07-07 22:15:04 -07:00
2026-07-13 23:26:10 +05:30
2026-07-06 01:37:10 +05:30
2026-07-04 13:28:47 -07:00
2026-07-01 15:11:38 +05:30
2026-06-26 00:11:17 +05:30
2026-07-19 00:45:32 -07:00
2026-07-20 11:52:41 +05:30
2026-05-29 19:06:05 -07:00
2026-06-22 05:41:22 -07:00
2026-06-20 10:26:45 -07:00
2026-05-22 14:21:41 -07:00
2026-07-18 20:01:55 +05:30
2026-05-22 14:21:41 -07:00
2026-06-28 00:57:03 -07:00
2026-07-01 15:38:34 -04:00
2026-07-01 00:12:17 -07:00
2026-05-22 14:21:41 -07:00
2026-05-28 22:26:25 -07:00
2026-07-07 02:40:12 -07:00
2026-07-05 06:42:42 -07:00
2026-07-22 07:14:42 -07:00
2026-06-21 22:43:45 -07:00
2026-07-01 00:12:17 -07:00
2026-07-05 13:58:11 -07:00
2026-07-07 06:25:23 -07:00
2026-07-07 17:01:08 -07:00
2026-06-27 03:57:24 +05:30
2026-07-01 16:25:16 +05:30
2026-05-22 14:21:41 -07:00
2026-05-28 22:26:25 -07:00
2026-07-18 20:01:55 +05:30
2026-05-22 14:21:41 -07:00
2026-07-18 14:01:33 -07:00
2026-07-07 02:40:12 -07:00
2026-05-27 03:35:33 -07:00
2026-06-30 02:48:42 -07:00
2026-07-07 06:25:23 -07:00
2026-07-07 05:50:08 -07:00
2026-05-22 14:21:41 -07:00
2026-05-22 14:21:41 -07:00
2026-05-22 14:21:41 -07:00
2026-07-01 03:56:28 -07:00
2026-05-22 14:21:41 -07:00
2026-07-07 17:00:58 -07:00
2026-07-07 12:42:29 -07:00
2026-06-22 13:58:33 -07:00
2026-05-28 22:26:25 -07:00
2026-07-07 12:42:29 -07:00
2026-06-05 03:10:40 -07:00
2026-07-18 12:28:59 -07:00
2026-07-01 01:20:14 -07:00
2026-06-21 22:43:45 -07:00
2026-06-11 11:58:19 -07:00
2026-06-25 21:29:57 -07:00
2026-07-02 03:12:53 -07:00
2026-07-01 03:56:28 -07:00
2026-05-30 07:28:06 -07:00
2026-07-02 03:00:59 -07:00
2026-06-25 21:29:57 -07:00
2026-07-13 23:26:10 +05:30
2026-05-30 07:38:03 -07:00
2026-07-09 02:22:12 +05:30
2026-05-28 22:26:25 -07:00
2026-07-20 03:27:22 -07:00
2026-06-20 10:26:45 -07:00
2026-07-01 03:56:28 -07:00
2026-06-28 00:57:03 -07:00
2026-06-30 17:20:41 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-27 04:13:09 -07:00
2026-07-20 09:19:24 -07:00
2026-07-20 09:28:24 -07:00
2026-07-01 02:29:24 -07:00
2026-07-16 04:40:23 -07:00
2026-05-28 22:26:25 -07:00
2026-07-16 08:02:47 -07:00
2026-05-27 02:41:24 -07:00
2026-06-23 23:29:28 -07:00
2026-05-28 22:26:25 -07:00
2026-07-01 15:59:37 +05:30
2026-07-18 20:01:55 +05:30
2026-06-14 03:25:08 -07:00
2026-07-20 05:38:25 -07:00
2026-07-18 12:28:59 -07:00
2026-06-29 15:51:57 -07:00
2026-07-16 05:39:58 -07:00
2026-05-28 22:26:25 -07:00
2026-07-18 01:30:05 -07:00
2026-07-15 09:48:24 -07:00
2026-06-21 11:11:23 -07:00
2026-06-20 10:57:41 -07:00
2026-06-25 21:29:57 -07:00
2026-05-28 22:26:25 -07:00
2026-06-21 12:43:44 -07:00
2026-06-01 20:30:24 -07:00
2026-07-02 00:05:48 +05:30
2026-06-19 07:35:33 -07:00
2026-06-25 21:29:57 -07:00
2026-06-04 21:55:20 -07:00
2026-05-28 22:26:25 -07:00
2026-05-24 15:03:27 -07:00
2026-06-20 10:26:45 -07:00
2026-06-28 20:47:33 -07:00
2026-07-21 12:04:47 -07:00
2026-06-20 10:26:45 -07:00
2026-07-20 11:10:49 -07:00
2026-07-01 05:38:03 -07:00
2026-06-20 21:22:11 -07:00
2026-07-20 11:10:49 -07:00
2026-07-16 05:39:58 -07:00
2026-06-08 15:12:12 -07:00
2026-06-05 09:10:26 -07:00
2026-05-26 14:28:51 -07:00
2026-06-21 11:56:46 -07:00
2026-06-20 23:20:16 -07:00
2026-06-20 10:26:45 -07:00
2026-07-18 14:01:33 -07:00
2026-06-16 15:49:59 -07:00
2026-05-28 22:26:25 -07:00
2026-06-27 19:26:04 -07:00
2026-06-27 03:43:28 -07:00
2026-06-27 03:43:38 -07:00
2026-06-27 04:36:22 -07:00
2026-06-21 13:33:23 -07:00
2026-07-22 11:19:37 +05:30
2026-07-22 11:19:37 +05:30
2026-07-18 14:01:56 -07:00
2026-07-16 07:22:24 -07:00
2026-07-18 20:01:55 +05:30
2026-07-16 15:59:45 +05:30
2026-07-16 07:57:06 -07:00
2026-06-30 15:30:06 -07:00
2026-06-19 07:34:15 -07:00
2026-07-08 00:34:34 +00:00
2026-07-15 12:11:16 -07:00
2026-07-07 18:25:39 +10:00
2026-07-23 12:51:13 +10:00
2026-07-03 03:33:06 -07:00
2026-07-04 16:34:16 -07:00
2026-07-05 21:48:59 -07:00
2026-05-29 13:17:46 -07:00
2026-07-01 03:56:28 -07:00
2026-07-01 05:31:15 -07:00
2026-07-07 02:18:17 -07:00
2026-06-25 21:29:57 -07:00
2026-06-25 21:29:57 -07:00
2026-06-02 05:52:54 -07:00
2026-06-30 14:29:51 -07:00
2026-07-17 20:55:24 +00:00
2026-07-22 04:40:07 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-25 21:29:57 -07:00
2026-07-22 10:31:59 +05:30
2026-05-28 22:26:25 -07:00
2026-07-01 02:12:25 -07:00
2026-07-10 12:38:48 +05:30
2026-07-22 04:19:10 -07:00
2026-07-15 09:50:05 -07:00
2026-07-19 14:58:59 +05:30
2026-07-05 00:41:34 -07:00
2026-07-09 19:09:38 -07:00
2026-07-22 20:55:51 -07:00
2026-07-05 21:48:59 -07:00
2026-07-03 03:33:06 -07:00
2026-07-05 13:57:37 -07:00
2026-07-11 08:42:21 -07:00
2026-07-12 00:26:49 -07:00
2026-07-14 11:46:40 -07:00
2026-06-25 21:29:57 -07:00
2026-07-08 00:20:23 +00:00
2026-05-22 14:21:41 -07:00
2026-07-21 12:40:21 -07:00
2026-07-19 08:25:35 +05:30
2026-06-20 15:16:53 +05:30
2026-07-05 02:12:26 -07:00
2026-07-05 13:42:46 -07:00
2026-06-08 01:25:35 -07:00
2026-07-20 12:11:07 +05:30
2026-07-17 04:51:39 -07:00
2026-07-16 05:08:56 -07:00
2026-07-05 13:58:03 -07:00
2026-05-20 13:00:57 -07:00
2026-07-20 13:04:12 -07:00
2026-07-01 17:08:50 +05:30
2026-07-20 07:24:07 -07:00
2026-05-30 07:38:03 -07:00
2026-07-18 20:01:55 +05:30
2026-07-21 12:40:21 -07:00
2026-06-03 23:51:44 -06:00
2026-06-19 06:31:13 -07:00
2026-07-18 20:01:55 +05:30
2026-06-26 14:01:48 +10:00
2026-06-24 18:47:18 -07:00
2026-06-21 12:34:22 -07:00
2026-06-20 10:26:45 -07:00
2026-06-25 21:29:57 -07:00
2026-06-25 21:29:57 -07:00
2026-06-16 15:49:59 -07:00
2026-07-05 13:58:03 -07:00
2026-07-01 05:38:03 -07:00
2026-07-01 15:42:19 +05:30
2026-05-28 22:26:25 -07:00
2026-06-27 04:13:09 -07:00
2026-07-09 18:04:00 -07:00
2026-07-01 02:29:24 -07:00
2026-07-22 11:19:37 +05:30
2026-06-25 01:26:13 +05:30
2026-07-04 16:34:16 -07:00
2026-07-02 05:51:12 -07:00
2026-05-23 02:25:53 -07:00
2026-06-07 22:10:32 -07:00
2026-06-29 15:51:57 -07:00
2026-07-17 04:51:39 -07:00
2026-06-25 21:29:57 -07:00
2026-06-04 07:50:45 -07:00
2026-07-17 04:51:39 -07:00
2026-07-17 20:55:24 +00:00
2026-07-14 17:13:20 +05:30
2026-07-22 06:56:08 -07:00
2026-07-17 04:51:39 -07:00
2026-07-22 07:22:55 -07:00
2026-06-20 10:26:45 -07:00
2026-07-22 07:22:55 -07:00
2026-07-18 20:01:55 +05:30
2026-07-18 19:53:00 +05:30
2026-06-20 13:47:14 +05:30
2026-05-28 22:26:25 -07:00
2026-07-16 05:39:58 -07:00
2026-06-12 01:07:50 -07:00
2026-07-22 20:59:12 -07:00
2026-07-22 06:58:34 -07:00
2026-07-22 06:58:34 -07:00
2026-07-01 16:32:32 +05:30
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-07-22 07:00:47 -07:00
2026-07-01 03:16:13 -07:00
2026-07-22 07:14:42 -07:00
2026-06-29 01:02:53 -07:00
2026-07-22 07:22:55 -07:00
2026-07-22 06:57:39 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-07-23 12:51:13 +10:00
2026-07-22 20:55:51 -07:00
2026-07-22 07:14:42 -07:00
2026-06-29 20:57:43 -07:00
2026-07-22 07:22:55 -07:00
2026-07-22 20:59:12 -07:00
2026-06-28 02:43:23 -07:00
2026-05-28 22:26:25 -07:00
2026-07-05 17:38:36 -07:00
2026-06-27 03:52:44 -07:00
2026-06-07 02:15:23 -07:00
2026-05-28 22:26:25 -07:00
2026-07-05 13:57:11 -07:00
2026-07-07 14:40:32 +05:30
2026-07-21 12:40:21 -07:00
2026-07-16 00:11:22 +05:30
2026-06-21 16:41:17 -07:00
2026-06-30 03:22:18 -07:00
2026-07-16 07:17:55 -07:00
2026-07-05 06:29:26 -07:00
2026-07-21 13:12:41 -07:00
2026-07-22 20:55:51 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-07-14 21:31:32 -07:00
2026-06-13 13:44:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-30 23:37:04 -07:00
2026-07-18 14:01:33 -07:00
2026-07-20 11:42:29 -04:00
2026-06-02 00:33:50 -07:00
2026-06-30 04:23:03 -07:00
2026-07-05 06:12:49 -07:00
2026-05-28 22:26:25 -07:00
2026-06-20 20:05:37 -07:00
2026-07-18 20:01:55 +05:30
2026-07-18 20:01:55 +05:30
2026-06-27 03:57:24 +05:30
2026-06-19 16:20:59 -07:00
2026-07-21 05:41:41 -07:00
2026-07-19 07:27:29 +05:30
2026-07-22 12:47:41 +05:30
2026-06-28 00:57:03 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-28 01:07:53 -07:00
2026-06-24 02:15:47 +05:30
2026-07-21 12:11:52 +05:30
2026-07-22 07:14:42 -07:00
2026-06-27 19:12:57 -07:00
2026-07-16 04:25:54 -07:00
2026-07-11 11:13:50 +05:30
2026-07-05 00:32:35 -07:00
2026-06-20 10:26:45 -07:00
2026-07-22 12:47:41 +05:30
2026-07-14 17:09:50 +05:30
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-07-04 13:48:33 +05:30
2026-07-21 12:11:52 +05:30
2026-07-17 20:55:24 +00:00
2026-07-22 17:14:36 -07:00
2026-06-20 10:26:45 -07:00
2026-06-30 15:36:58 -07:00
2026-05-28 22:26:25 -07:00
2026-07-14 17:32:41 +05:30
2026-05-28 22:26:25 -07:00
2026-06-22 12:29:05 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-07-14 06:48:53 -07:00
2026-06-21 08:26:28 -07:00
2026-06-20 10:26:45 -07:00
2026-07-14 17:32:41 +05:30
2026-06-20 10:26:45 -07:00
2026-07-07 15:50:41 +05:30
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-30 17:39:30 -07:00
2026-07-06 03:18:33 -07:00
2026-07-05 21:57:55 -07:00
2026-07-07 02:39:31 -07:00
2026-06-27 04:01:58 -07:00
2026-07-16 04:40:35 -07:00
2026-07-19 07:27:29 +05:30
2026-06-20 10:26:45 -07:00
2026-07-20 11:10:49 -07:00
2026-06-29 15:51:57 -07:00
2026-07-02 05:09:38 -07:00
2026-07-06 03:42:14 -07:00
2026-05-28 22:26:25 -07:00
2026-06-25 21:29:57 -07:00
2026-07-13 04:31:55 -07:00
2026-07-19 03:49:29 -07:00
2026-06-29 21:12:57 -07:00
2026-06-28 02:05:26 -07:00
2026-06-01 02:04:14 -07:00
2026-07-04 13:38:59 -07:00
2026-07-22 16:51:01 -04:00
2026-07-07 22:15:04 -07:00
2026-06-04 06:56:28 -07:00
2026-07-14 03:23:19 -07:00
2026-07-05 06:29:26 -07:00
2026-06-05 18:05:05 -07:00
2026-06-13 03:33:27 -07:00
2026-07-01 03:56:28 -07:00
2026-05-28 22:26:25 -07:00
2026-06-21 19:05:27 -07:00
2026-07-16 07:22:24 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-07-02 17:39:09 -07:00
2026-06-28 22:35:43 -07:00
2026-07-01 03:56:28 -07:00
2026-06-07 21:50:57 -07:00
2026-06-07 22:10:17 -07:00
2026-07-01 03:56:28 -07:00
2026-06-20 17:05:27 -07:00
2026-06-21 17:23:33 -07:00
2026-07-05 00:41:34 -07:00
2026-07-16 07:22:24 -07:00
2026-06-21 17:23:33 -07:00
2026-07-05 06:27:20 -07:00
2026-07-01 03:56:28 -07:00
2026-07-01 03:56:28 -07:00
2026-06-28 02:05:26 -07:00
2026-06-30 15:30:06 -07:00
2026-07-05 06:27:20 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-21 13:32:22 -07:00
2026-06-20 10:26:45 -07:00
2026-06-28 15:29:59 -07:00