Repository navigation
Conversation
Greptile SummaryThis PR adds Key changes:
Issues found:
Confidence Score: 4/5
Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/slack/monitor/message-handler/prepare.test.ts
Line: 446-447
Comment:
**Missing cache cleanup risks test pollution**
`recordSlackThreadParticipation` writes to a module-level singleton (`threadParticipation` map in `sent-thread-cache.ts`). This entry (`"default:C123:1.000"`) persists for the rest of the test run. The `clearSlackThreadParticipationCache()` helper exists precisely for this — `sent-thread-cache.test.ts` always calls it in `beforeEach`/`afterEach`. Any future test that happens to use `accountId: "default"`, `channel: "C123"`, and `thread_ts: "1.000"` will unexpectedly find `implicitMention: true`.
Consider importing and calling `clearSlackThreadParticipationCache` after the assertion:
```suggestion
const { recordSlackThreadParticipation, clearSlackThreadParticipationCache } = await import("../../sent-thread-cache.js");
recordSlackThreadParticipation("default", "C123", "1.000");
```
…and adding a teardown in an `afterEach` (or at the end of this test) to clear the cache:
```ts
afterEach(async () => {
const { clearSlackThreadParticipationCache } = await import("../../sent-thread-cache.js");
clearSlackThreadParticipationCache();
});
```
How can I resolve this? If you propose a fix, please make it concise.Last reviewed commit: 5e6a86c |
ec0e0c8 to
8fe6636
Compare
|
This pull request has been automatically marked as stale due to inactivity. |
|
Codex review: needs changes before merge. Summary Reproducibility: yes. Source inspection is enough for this feature gap: current Slack config accepts only boolean Next step before merge Security Review findings
Review detailsBest possible solution: Retarget or replace the PR with an active Do we have a high-confidence way to reproduce the issue? Yes. Source inspection is enough for this feature gap: current Slack config accepts only boolean Is this the best way to solve the issue? No. The requested direction is consistent with Discord and Matrix, but the submitted patch is not the best fix because it updates retired Full review comments:
Overall correctness: patch is incorrect Security concerns:
Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 5f373ae4d3db. |
|
Landed the Slack I did not merge this PR directly because the branch was conflict-marked against current Verification:
Thanks @raw34. |
Summary
"mentions"as a valid value for Slack'sallowBotsconfig, matching Discord's existingallowBots: "mentions"implementation"mentions", only bot messages that explicitly @mention the receiving bot (or have implicit mention via thread participation) are processedCloses #43587
Changes
6 files modified:
src/config/types.slack.tsallowBotstype:boolean→boolean | "mentions"(bothSlackChannelConfigandSlackAccountConfig)src/slack/monitor/channel-config.tssrc/config/zod-schema.providers-core.tsSlackChannelSchemaandSlackAccountSchemasrc/slack/monitor/message-handler/prepare.tsallowBotsModeresolution + mentions-mode gate after mention gatingsrc/config/schema.help.tssrc/slack/monitor/message-handler/prepare.test.tsBehavior:
allowBotsvaluefalse(default)true"mentions"Discord reference:
src/discord/monitor/message-handler.preflight.ts:142-144, 661-668Test plan
allowBots=mentionsallowBots=mentionsallowBots=mentionsallowBots=mentionsallowBots: trueandallowBots: falsetests still pass🤖 Generated with Claude Code