Skip to content

[3555 by Claude Opus 5.5] Official plugin: Slack app mode (threads per pull request, mention to start a task) - #3586

Merged
propr-dev[bot] merged 3 commits into
3542-epic-plugin-system-xu8from
3555/claude-opus-5-5-official-plugin-slack-app-20261116-1521-orr
Nov 16, 2026
Merged

propr-dev[bot] merged 3 commits into
3542-epic-plugin-system-xu8from
3555/claude-opus-5-5-official-plugin-slack-app-20261116-1521-orr

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #3555

Branch: 3555/claude-opus-5-5-official-plugin-slack-app-20261116-1521-orr
Commits: ✅ Changes committed (ab3b6f8)


AI Processing Completed

Execution Details:

Summary:
I've added a Slack app mode to the slack plugin. With their own Slack app, a team gets one thread per pull request, and mentioning the bot in a mapped channel creates a GitHub issue with the trigger label. Incoming-webhook mode is unchanged and stays the default.

Tests: these pass:

  • all plugin suites (56 tests), including the new packages/plugins/test/slackApp.test.ts.
  • the new core test packages/core/test/slackPluginEvents.test.ts.
  • the existing core plugin and webhook suites and the API plugin route suites.
  • plugins:check, zero-warning lint and typecheck on the plugins package.

I broke the code on purpose in three places (retry de-duplication, HTML escaping, thread reuse) and the new tests failed each time. I did not run the full repository suite, the docs build, or the existing Plugins Playwright specs. Nothing was tested against a real Slack workspace; the README has a manual checklist for that.

What changed

  • Manifest:
    • new connections: a bot token (sent only to slack.com) and a signing secret.
    • new permission: issues.create.
    • new settings: Delivery mode (incoming-webhook by default, or app), Repository channels (repository → channel ID), Default channel, allowed user IDs, allowed user group, and Trigger label (default AI).
    • one inbound events webhook, verified with slack-v0, plus a function that answers Slack's URL verification challenge at once.
  • Mentions (slack/mentions.ts): a mention from a person (bots, edits and other message subtypes are ignored) creates one issue in the repository mapped to the channel. The title is the first line, the body quotes the request with a link back to Slack, and the only label is the trigger label. The bot replies in the thread with the issue link. People not on the allow-list get a polite refusal. An unmapped channel, a channel mapped to several repositories, or an empty mention gets a short explanation and creates nothing.
  • Untrusted text: the request text only ever becomes the issue's title and body. HTML and <!-- … --> markers are escaped and @mentions are made inert. The repository comes from the channel, the label from settings, and the model from ProPR's own routing.
  • Retries: each handled message is remembered in ctx.state, so a retried Slack event or delivery creates no second issue. If issue creation fails in a way that may still have created the issue, the delivery fails and is not retried, so a request never produces two issues.
  • Threads (slack/threads.ts, slack/appDelivery.ts): the first update about a pull request starts its thread and later updates reply there. A pull request whose issue came from a mention uses the mention's thread. If the thread's first message was deleted, a new thread is started.
  • Docs: the README has the Slack app manifest, the scopes (app_mentions:read, chat:write, usergroups:read), a manual smoke-test checklist and links to the Slack documentation I checked. docs/docs/plugins/slack.md has a new app-mode section, and the plugin list in docs/docs/features/plugins.md is updated.
  • Shared test changes: I loosened the Slack-specific expectations in chatNotifications.test.ts for the new connections, and added an official option to the core test helper pluginHandlerFixture.

Limitations:

  • App mode only talks to slack.com, so GovSlack workspaces need incoming-webhook mode.
  • The plugin keeps the 150 most recent thread mappings; older pull requests start a new thread.

I captured five previews of the Slack plugin's page (connections, webhook URL, settings, phone width). They are built from the real manifest with mocked API data, using a temporary Playwright spec that I deleted afterwards.

Acceptance criteria

  • AC1: met — packages/core/test/slackPluginEvents.test.ts (signed fixtures in slack/fixtures/events.json accepted; a tampered body, wrong secret, stale or missing timestamp refused; the challenge answered through the real receiver) and the challenge test in packages/plugins/test/slackApp.test.ts
  • AC2: met — slackApp.test.ts ("a mention from an allowed user … retries create no second issue") and slackPluginEvents.test.ts (one issue for the event and its Slack retry through the real receiver)
  • AC3: met — slackApp.test.ts ("a non-allowed user, an unmapped channel, a bot message or an empty mention creates nothing"), covering own-bot and other-bot messages
  • AC4: met — slackApp.test.ts ("message text cannot set the labels, the repository or the model (injection)"), using the injection fixture
  • AC5: met — slackApp.test.ts ("events for a pull request reuse its stored thread…" and "the incoming-webhook mode keeps working…"), and the unchanged incoming-webhook cases in chatNotifications.test.ts
  • AC6: met — slackApp.test.ts ("no message contains code, logs, prompt text, tool output or credentials (sentinel)"), plus the existing sentinel test in chatNotifications.test.ts
  • AC7: met — packages/plugins/slack/README.md (app manifest, required scopes, smoke-test checklist, Slack doc links) and docs/docs/plugins/slack.md (new app-mode section)

Review digest

Acceptance criteria (7 of 7 met, as stated by the agent)

  • ✅ AC1 (met): Signature and timestamp verification and the challenge response work (fixtures). — `packages/core/test/slackPluginEvents.test.ts` (signed fixtures in `slack/fixtures/events.json` accepted; a tampered body, wrong secret, stale or missing timestamp refused; the challenge answered through the real receiver) and the challenge test in `packages/plugins/test/slackApp.test.ts`
  • ✅ AC2 (met): A mention from an allowed user in a mapped channel creates one issue with the trigger label and replies in thread; retries of the same Slack event create no second issue. — `slackApp.test.ts` ("a mention from an allowed user … retries create no second issue") and `slackPluginEvents.test.ts` (one issue for the event and its Slack retry through the real receiver)
  • ✅ AC3 (met): A mention from a non-allowed user, in an unmapped channel, or a bot's own message creates nothing. — `slackApp.test.ts` ("a non-allowed user, an unmapped channel, a bot message or an empty mention creates nothing"), covering own-bot and other-bot messages
  • ✅ AC4 (met): Message text cannot set labels, the repository or the model (injection test). — `slackApp.test.ts` ("message text cannot set the labels, the repository or the model (injection)"), using the `injection` fixture
  • ✅ AC5 (met): Events for a pull request reuse the stored thread; the incoming-webhook mode from the previous issue keeps working. — `slackApp.test.ts` ("events for a pull request reuse its stored thread…" and "the incoming-webhook mode keeps working…"), and the unchanged incoming-webhook cases in `chatNotifications.test.ts`
  • ✅ AC6 (met): No message contains code, logs, prompt text, tool output or credentials (sentinel test). — `slackApp.test.ts` ("no message contains code, logs, prompt text, tool output or credentials (sentinel)"), plus the existing sentinel test in `chatNotifications.test.ts`
  • ✅ AC7 (met): README with the Slack app manifest, required scopes and a manual smoke-test checklist; `docs/docs/plugins/slack.md` updated. — `packages/plugins/slack/README.md` (app manifest, required scopes, smoke-test checklist, Slack doc links) and `docs/docs/plugins/slack.md` (new app-mode section)

Risk-tiered paths

  • High risk: none
  • Normal risk (6 files)
    • packages/plugins/slack/api.ts (added, +94/−0)
    • packages/plugins/slack/appDelivery.ts (added, +59/−0)
    • packages/plugins/slack/handlers.ts (+21/−6)
    • packages/plugins/slack/manifest.json (+83/−6)
    • packages/plugins/slack/mentions.ts (added, +262/−0)
    • packages/plugins/slack/threads.ts (added, +86/−0)
  • Low risk (9 files)
    • docs/docs/features/plugins.md (+1/−1)
    • docs/docs/plugins/slack.md (+197/−16)
    • packages/core/test/helpers/pluginHandlerFixture.ts (+4/−3)
    • packages/core/test/slackPluginEvents.test.ts (added, +119/−0)
    • packages/plugins/slack/README.md (+169/−20)
    • packages/plugins/slack/fixtures/events.json (added, +67/−0)
    • packages/plugins/slack/fixtures/webApi.json (added, +15/−0)
    • packages/plugins/test/chatNotifications.test.ts (+6/−4)
    • packages/plugins/test/slackApp.test.ts (added, +340/−0)

Validation evidence

  • No repository validation commands ran.

Diff size: 15 files changed, +1,523/−56 lines

Detailed Logs:

  • Conversation: 77 messages
  • Session: 52848955-3ab6-4bc4-b5b0-c744ece6839d

Log files stored at:

  • conversation: /usr/src/app/logs/executions/issue-3555-2026-11-16T15-45-00-348Z-conversation.json
  • output: /usr/src/app/logs/executions/issue-3555-2026-11-16T15-45-00-348Z-output.txt
Latest Conversation Messages
ASSISTANT: [content unavailable]

ASSISTANT: I've added a Slack app mode to the `slack` plugin. With their own Slack app, a team gets one thread per pull request, and mentioning the bot in a mapped channel creates a GitHub issue with the trigger...


This PR was created automatically by ProPR after processing issue #3555.


💡 Need changes?

Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!


Visual preview

Slack app connections

Slack app connections

Plugins › Slack, Connect step at 1440px: the new Bot token and Signing secret (app mode) connections and the plugin's events webhook URL (Slack slack-v0 verification) to paste as the Events API request URL. Rendered from the real slack/manifest.json with mocked API data.

Full-size original

Who may start tasks and trigger label

Who may start tasks and trigger label

Configure step: the allow-list (Slack user IDs and user group ID) and the Trigger label put on issues created from mentions.

Full-size original

Delivery mode setting

Delivery mode setting

Configure step: Delivery mode set to app, with its help text; incoming-webhook stays the default.

Full-size original

Repository channels on a phone

Repository channels on a phone

Configure step at 390px: Repository channels mapping integry/propr to a Slack channel ID, Default channel and the user allow-list.

Full-size original

Events API request URL

Events API request URL

The Webhook URLs section of the Slack plugin: the events webhook with Copy and Regenerate.

Full-size original

…ck app, a team gets one thread per pull request, and mentioning the bot in a mapped channel creates a GitHub issue with the trigger label. Incoming-webhook mode is unchanged and stays the default.

Tests: these pass:
- all plugin suites (56 tests), including the new `packages/plugins/test/slackApp.test.ts`.
- the new core test `packages/core/test/slackPluginEvents.test.ts`.
- the existing core plugin and webhook suites and the API plugin route suites.
- `plugins:check`, zero-warning lint and typecheck on the plugins package.

I broke the code on purpose in three places (retry de-duplication, HTML escaping, thread reuse) and the new tests failed each time. I did not run the full repository suite, the docs build, or the existing Plugins Playwright specs. Nothing was tested against a real Slack workspace; the README has a manual checklist for that.

What changed
- Manifest:
  - new connections: a bot token (sent only to `slack.com`) and a signing secret.
  - new permission: `issues.create`.
  - new settings: Delivery mode (`incoming-webhook` by default, or `app`), Repository channels (repository → channel ID), Default channel, allowed user IDs, allowed user group, and Trigger label (default `AI`).
  - one inbound `events` webhook, verified with `slack-v0`, plus a function that answers Slack's URL verification challenge at once.
- Mentions (`slack/mentions.ts`): a mention from a person (bots, edits and other message subtypes are ignored) creates one issue in the repository mapped to the channel. The title is the first line, the body quotes the request with a link back to Slack, and the only label is the trigger label. The bot replies in the thread with the issue link. People not on the allow-list get a polite refusal. An unmapped channel, a channel mapped to several repositories, or an empty mention gets a short explanation and creates nothing.
- Untrusted text: the request text only ever becomes the issue's title and body. HTML and `<!-- … -->` markers are escaped and `@mentions` are made inert. The repository comes from the channel, the label from settings, and the model from ProPR's own routing.
- Retries: each handled message is remembered in `ctx.state`, so a retried Slack event or delivery creates no second issue. If issue creation fails in a way that may still have created the issue, the delivery fails and is not retried, so a request never produces two issues.
- Threads (`slack/threads.ts`, `slack/appDelivery.ts`): the first update about a pull request starts its thread and later updates reply there. A pull request whose issue came from a mention uses the mention's thread. If the thread's first message was deleted, a new thread is started.
- Docs: the README has the Slack app manifest, the scopes (`app_mentions:read`, `chat:write`, `usergroups:read`), a manual smoke-test checklist and links to the Slack documentation I checked. `docs/docs/plugins/slack.md` has a new app-mode section, and the plugin list in `docs/docs/features/plugins.md` is updated.
- Shared test changes: I loosened the Slack-specific expectations in `chatNotifications.test.ts` for the new connections, and added an `official` option to the core test helper `pluginHandlerFixture`.

Limitations:
- App mode only talks to `slack.com`, so GovSlack workspaces need incoming-webhook mode.
- The plugin keeps the 150 most recent thread mappings; older pull requests start a new thread.

I captured five previews of the Slack plugin's page (connections, webhook URL, settings, phone width). They are built from the real manifest with mocked API data, using a temporary Playwright spec that I deleted afterwards.

Acceptance criteria
- AC1: met — `packages/core/test/slackPluginEvents.test.ts` (signed fixtures in `slack/fixtures/events.json` accepted; a tampered body, wrong secret, stale or missing timestamp refused; the challenge answered through the real receiver) and the challenge test in `packages/plugins/test/slackApp.test.ts`
- AC2: met — `slackApp.test.ts` ("a mention from an allowed user … retries create no second issue") and `slackPluginEvents.test.ts` (one issue for the event and its Slack retry through the real receiver)
- AC3: met — `slackApp.test.ts` ("a non-allowed user, an unmapped channel, a bot message or an empty mention creates nothing"), covering own-bot and other-bot messages
- AC4: met — `slackApp.test.ts` ("message text cannot set the labels, the repository or the model (injection)"), using the `injection` fixture
- AC5: met — `slackApp.test.ts` ("events for a pull request reuse its stored thread…" and "the incoming-webhook mode keeps working…"), and the unchanged incoming-webhook cases in `chatNotifications.test.ts`
- AC6: met — `slackApp.test.ts` ("no message contains code, logs, prompt text, tool output or credentials (sentinel)"), plus the existing sentinel test in `chatNotifications.test.ts`
- AC7: met — `packages/plugins/slack/README.md` (app manifest, required scopes, smoke-test checklist, Slack doc links) and `docs/docs/plugins/slack.md` (new app-mode section)
@propr-dev

propr-dev Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

/ultrafix goal=8 max=10
Triggered automatically by the requested execution settings.

@propr-dev propr-dev Bot added the ultrafix label Nov 16, 2026
@propr-dev

propr-dev Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 10)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev

propr-dev Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR adds Slack app delivery and mention-driven issue creation with clear separation from incoming-webhook delivery. It needs changes before merge because bounded mention history breaks the promised retry deduplication.

✅ Verified inbound requests — The manifest selects slack-v0, and receiver tests cover signatures, stale timestamps, and challenge responses.

✅ Controlled issue creation — Repository selection and labels come from settings; request text is confined to title and body.

✅ Existing delivery preserved — Incoming-webhook mode remains the default and delegates to the existing delivery implementation.

This review is a static analysis of the supplied code; no commands were run. The supplied current-head status has no failures and five pending checks.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F1: 🔴 Eviction allows retries to create duplicate issues

  • Category: correctness

  • Required behavior: AC2 requires retries of the same Slack event to create no second issue, including after an uncertain creation outcome.

  • Evidence: packages/plugins/slack/threads.ts:writeMention, packages/plugins/slack/mentions.ts:handleSlackEvent

    1. An allowed mention creates an issue and stores its message identity in the mentions list.
    2. Fifty other distinct mentions are handled before a retry arrives. Refused and ignored mentions also enter this same list.
    3. writeMention drops the original record because MAX_MENTIONS is 50; the byte limit can evict records even earlier.
    4. A retry of the original message reaches readMention, finds nothing, and calls createIssue again. The duplicate issue receives the trigger label and can start another task.

    The same eviction removes pending records left after uncertain creation, defeating their protection against duplicate creation. No age or retry-window check protects these records. Signature verification authenticates a retry but does not deduplicate it, and the receiver test explicitly establishes that Slack retries become separate deliveries. Existing tests exercise immediate retries and storage limits separately, without replaying an evicted message.

    static trace: This sequence follows directly from the list eviction and the missing-record creation branch; it requires no concurrent execution. proposed regression: Handle an allowed mention, handle fifty distinct refused mentions, then replay the original and assert that only one issue exists.

  • Minimum fix: Retain deduplication records throughout the supported retry horizon, including unresolved creation records. When storage capacity is reached, reject or defer new intake rather than evicting still-needed records; ensure expired events cannot re-enter creation after their records are removed.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Verify concurrent delivery behavior

The supplied receiver test waits for the runner to become idle before submitting a retry. A follow-up test with overlapping deliveries would clarify whether runner serialization protects the separate read/check/write operations in mention handling and thread creation. This is optional here because the supplied excerpts do not establish a reachable concurrent execution defect.

S2: 🟢 Complete the workspace smoke test

The documented manual checklist would provide useful evidence for actual Slack installation, thread deletion, and user-group behavior beyond mocked responses. This is additional integration confidence, not a separately verified code blocker.

Score

The implementation has useful focused coverage and preserves existing delivery, but its deduplication retention policy violates a central acceptance criterion and can initiate duplicate work. Pending checks provide no evidence of failure.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 0s
  • Tokens: 81,856 (80,854 in / 1,002 out)
  • Cost: $0.75

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F1 S1 S2

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 3a6dbae

Addressed 1 AI review comment (IDs: 6921385764)

Addressed finding F1

Summary of Changes

I fixed F1: once a mention has created an issue, or might have, no later mention can push its record out while a retry of that message is still possible. A replay after many other mentions now finds the record and creates nothing.

What changed

  • New packages/plugins/slack/mentionRecords.ts: the mention records moved here from threads.ts.
    • Issue records are never dropped early. Records that stand for an issue (pending, created, replied) stay until they expire. When space runs out, the oldest refused and ignored records go first. Losing one of those can at worst repeat a reply, never create an issue.
    • A full store defers new mentions. If issue records alone fill a shard, writeMention returns false. The handler then fails the delivery as retryable (in 10 minutes) before calling createIssue, instead of forgetting a record it still needs.
    • Space is reserved up front. Each unfinished record is counted at its largest size (with an issue number and link), so recording the created issue and the reply never needs more room than was set aside. Issue links over 200 characters aren't stored; the reply then names the issue without a link.
    • Records are kept long enough. A record lasts about 26 hours past the later of its message time and its last write. That covers the one-hour intake window plus the longest a delivery can be retried: four retries at the 6-hour maximum Retry-After, plus handler timeouts, plus an hour of margin.
    • More room. Records are spread over four state keys (mentions:0 to mentions:3, chosen by a hash of the message), each capped at 12 KB, under the 16 KB per-value limit.
  • mentions.ts: a mention received more than an hour after it was posted is now ignored (reason expired) before any record is read, and nothing is replied. The check uses receivedAt, which ProPR's retries of a delivery keep, so an old event cannot reach creation again after its record has expired.
  • Docs: the README and docs/docs/plugins/slack.md now describe the one-hour window, the retention, and deferral when the store is full.

Tests

  • New packages/plugins/test/slackMentionRecords.test.ts, with four tests:
    • An allowed mention, then 1,000 distinct refused mentions, then a replay of the original: still one issue. This is the regression the finding proposed.
    • An uncertain creation (a pending record), then 1,000 refused mentions, then a retry: createIssue is not called again.
    • Issues are created until a shard fills: the next mention is deferred as retryable and creates nothing, and a retry of every earlier issue's message is still a duplicate.
    • A mention just past the one-hour window is ignored without any request; one at the edge is still accepted. An expired record is dropped by the next write to its shard while unexpired ones stay.
  • Negative checks: with issue records evictable again, the first three tests fail; with the age check removed, the fourth fails.
  • Passing: all plugin suites (60 tests, including the updated storage-limit assertion in slackApp.test.ts), packages/core/test/slackPluginEvents.test.ts, plugins typecheck, zero-warning lint, and plugins:check ("5 plugins checked"). I did not run the docs build or the full repository suite. No previews, since nothing visible changed.

Behaviour changes to know about

  • A mention delivered more than an hour after it was posted creates nothing and gets no reply.
  • If a shard fills (roughly 40 to 100 mentions with issues within about 26 hours, depending on how many are unfinished), new mentions are retried with no reply in the thread. A mention still deferred when its retries run out fails without creating an issue.

Found separately, not fixed (outside F1): the mention records are updated by read-then-write, with nothing stopping two handler runs at once. Two deliveries for the same message running together could both find no record and create two issues. Two runs for different messages in the same shard could overwrite each other's records. This has the same effect as F1 but a different cause (concurrency rather than eviction), and fixing it needs an atomic compare-and-set or per-message serialisation in plugin state.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (3 files)
    • packages/plugins/slack/mentionRecords.ts (added, +102/−0)
    • packages/plugins/slack/mentions.ts (+12/−2)
    • packages/plugins/slack/threads.ts (+2/−33)
  • Low risk (4 files)
    • docs/docs/plugins/slack.md (+5/−0)
    • packages/plugins/slack/README.md (+4/−1)
    • packages/plugins/test/slackApp.test.ts (+1/−1)
    • packages/plugins/test/slackMentionRecords.test.ts (added, +129/−0)

Validation evidence

  • No repository validation commands ran.

Diff size: 7 files changed, +255/−37 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 8m 48s
  • Tokens: 2,586,336 (2,559,747 in / 26,589 out)
  • Cost: $1.50
  • Subscription usage: Fable +1%

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…ave, no later mention can push its record out while a retry of that message is still possible. A replay after many other mentions now finds the record and creates nothing.

I fixed F1: once a mention has created an issue, or might have, no later mention can push its record out while a retry of that message is still possible. A replay after many other mentions now finds the record and creates nothing.

**What changed**
- **New `packages/plugins/slack/mentionRecords.ts`:** the mention records moved here from `threads.ts`.
  - **Issue records are never dropped early.** Records that stand for an issue (`pending`, `created`, `replied`) stay until they expire. When space runs out, the oldest refused and ignored records go first. Losing one of those can at worst repeat a reply, never create an issue.
  - **A full store defers new mentions.** If issue records alone fill a shard, `writeMention` returns false. The handler then fails the delivery as retryable (in 10 minutes) before calling `createIssue`, instead of forgetting a record it still needs.
  - **Space is reserved up front.** Each unfinished record is counted at its largest size (with an issue number and link), so recording the created issue and the reply never needs more room than was set aside. Issue links over 200 characters aren't stored; the reply then names the issue without a link.
  - **Records are kept long enough.** A record lasts about 26 hours past the later of its message time and its last write. That covers the one-hour intake window plus the longest a delivery can be retried: four retries at the 6-hour maximum `Retry-After`, plus handler timeouts, plus an hour of margin.
  - **More room.** Records are spread over four state keys (`mentions:0` to `mentions:3`, chosen by a hash of the message), each capped at 12 KB, under the 16 KB per-value limit.
- **`mentions.ts`:** a mention received more than an hour after it was posted is now ignored (reason `expired`) before any record is read, and nothing is replied. The check uses `receivedAt`, which ProPR's retries of a delivery keep, so an old event cannot reach creation again after its record has expired.
- **Docs:** the README and `docs/docs/plugins/slack.md` now describe the one-hour window, the retention, and deferral when the store is full.

**Tests**
- **New `packages/plugins/test/slackMentionRecords.test.ts`**, with four tests:
  - An allowed mention, then 1,000 distinct refused mentions, then a replay of the original: still one issue. This is the regression the finding proposed.
  - An uncertain creation (a `pending` record), then 1,000 refused mentions, then a retry: `createIssue` is not called again.
  - Issues are created until a shard fills: the next mention is deferred as retryable and creates nothing, and a retry of every earlier issue's message is still a duplicate.
  - A mention just past the one-hour window is ignored without any request; one at the edge is still accepted. An expired record is dropped by the next write to its shard while unexpired ones stay.
- **Negative checks:** with issue records evictable again, the first three tests fail; with the age check removed, the fourth fails.
- **Passing:** all plugin suites (60 tests, including the updated storage-limit assertion in `slackApp.test.ts`), `packages/core/test/slackPluginEvents.test.ts`, plugins typecheck, zero-warning lint, and `plugins:check` ("5 plugins checked"). I did not run the docs build or the full repository suite. No previews, since nothing visible changed.

**Behaviour changes to know about**
- A mention delivered more than an hour after it was posted creates nothing and gets no reply.
- If a shard fills (roughly 40 to 100 mentions with issues within about 26 hours, depending on how many are unfinished), new mentions are retried with no reply in the thread. A mention still deferred when its retries run out fails without creating an issue.

**Found separately, not fixed (outside F1):** the mention records are updated by read-then-write, with nothing stopping two handler runs at once. Two deliveries for the same message running together could both find no record and create two issues. Two runs for different messages in the same shard could overwrite each other's records. This has the same effect as F1 but a different cause (concurrency rather than eviction), and fixing it needs an atomic compare-and-set or per-message serialisation in plugin state.

PR: #3586
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

⏳ Ultrafix is waiting for CI before the next /review.

These blocking checks on 3a6dbae are holding the loop back:

  • Full Test Suite Shard 2/4 — not finished
  • Full Test Suite Shard 1/4 — not finished
  • Full Test Suite Shard 3/4 — not finished
  • Full Test Suite Shard 4/4 — not finished
  • Classify changed surfaces — not finished
  • Classify changed surfaces — not finished
  • Validate Changes — not finished
  • Classify changed surfaces — not finished
  • Classify changed surfaces — not finished
  • Classify changed surfaces — not finished

Checks matching this repository's non-blocking checks never gate Ultrafix. The loop continues automatically once the blocking checks pass; if they have not settled within 2 hours, Ultrafix stops.

@propr-dev

propr-dev Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR adds Slack app delivery, mention-driven issue creation, and persistent thread mappings while preserving incoming-webhook delivery. It needs a localized recovery fix before merge.

✅ Verified inbound requests — The receiver verifies signatures and timestamps before invoking the challenge responder or mention handler.

✅ Controlled issue creation — Repository selection and labels come from settings, while request HTML and attribution-like markers are escaped.

✅ Broad test coverage — Tests cover authorization, sequential retries, bounded mention storage, thread reuse, and sensitive-content exclusion. Current-head checks report 24 passed and no failures.

This review used static analysis of the supplied code; no commands were run.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F2: 🔴 Restore thread mapping during recovery

  • Category: correctness

  • Required behavior: AC5 and the advertised behavior require pull-request updates for an issue created from a mention to reuse that mention’s thread, including after a retried delivery.

  • Evidence: packages/plugins/slack/mentions.ts:handleSlackEvent, specifically the seen.s === 'created' recovery branch and the separate writeMention(... 'created') / rememberThread(...) calls.

    1. An allowed mention creates an issue, and writeMention successfully persists its created record.
    2. The handler times out while awaiting a state operation inside rememberThread, before the issue-to-thread mapping commits. The supplied state-store guard prevents a timed-out handler from committing subsequent state changes.
    3. ProPR retries the delivery. The handler reads the durable created record, posts the issue-link reply, and changes the record to replied.
    4. That recovery branch never calls rememberThread. Subsequent pull-request events cannot find the mention’s issue mapping and start a new Slack thread, despite the reply promising updates in the original thread.

    static trace: The timeout, retry, and guarded state-write contracts are supplied in pluginSdk.ts, pluginDeliveries.ts, and pluginStateStore.ts. The existing reply-retry test fails posting only after rememberThread has succeeded, so it does not cover this interruption boundary.

  • Minimum fix: In the created recovery branch, ensure the issue-to-thread mapping exists before posting the reply and marking the mention replied. Add a regression covering interruption after creation is recorded but before the mapping is stored.

Suggestions

These are optional follow-ups and are not sent to /fix.

S3: 🟢 Exercise overlapping webhook deliveries

The retry tests process deliveries sequentially. A receiver-level test submitting the original event and its retry before awaiting runner completion would provide useful evidence that runner serialization protects the mention records’ read-modify-write operations. This is optional coverage: the supplied excerpts do not establish a reachable concurrency defect.

Score

The implementation is focused and well tested, with passing current-head checks. One recoverable interruption can permanently break the promised thread association, requiring a small correction.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 51s
  • Tokens: 84,947 (83,781 in / 1,166 out)
  • Cost: $0.79

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F2 S3

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 2d22dd2

Addressed 1 AI review comment (IDs: 6922232700)

Addressed finding F2

Summary of Changes

I fixed F2. When a Slack mention is delivered again and its record says the issue was created but no reply has gone out yet, the handler now saves the issue's thread before posting the reply and marking the mention replied. So if the first attempt stopped after creating the issue but before saving the thread, the issue's pull request still posts in the mention's thread.

Change (packages/plugins/slack/mentions.ts, in handleSlackEvent's created recovery branch): the handler first checks with findThread whether the issue already has a thread. If not, it saves the mention's thread with rememberThread, then replies. If a thread is already saved, it is left alone. That covers the case where app mode started a new thread because the original first message was deleted.

Regression test (packages/plugins/test/slackApp.test.ts, in the existing reply-retry test): the first attempt is made to fail on the thread write, right after the created record is saved, standing in for a handler timeout. The test then checks that:

  • there is no thread and no reply after that attempt.
  • the retry saves the thread in the mention's channel and thread.
  • exactly one issue-link reply is posted.
  • a later pull_request.opened event for that issue reuses the mention's thread.

With the fix removed, this test fails.

Verification: these all pass:

  • every plugin suite.
  • packages/core/test/slackPluginEvents.test.ts.
  • plugins:check ("5 plugins checked").
  • the plugins package typecheck.
  • zero-warning lint on the two changed files.

I did not run the full repository suite.

Other paths with the same assumption:

  • A replied record always has its thread saved, because the thread is written before replied. It can still lose the thread to the existing 150-thread limit, which is already listed under Limitations.
  • An attempt that stops while the mention is still pending cannot be recovered this way, because the issue number was never recorded. That is the at-most-one-issue behaviour that was already there, so I left it.

No previews: the change is not visible in the UI.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (1 file)
    • packages/plugins/slack/mentions.ts (+4/−1)
  • Low risk (1 file)
    • packages/plugins/test/slackApp.test.ts (+19/−0)

Validation evidence

  • No repository validation commands ran.

Diff size: 2 files changed, +23/−1 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 4m 27s
  • Tokens: 641,693 (637,273 in / 4,420 out)
  • Cost: $0.49

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

… record says the issue was `created` but no reply has gone out yet, the handler now saves the issue's thread before posting the reply and marking the mention `replied`. So if the first attempt stopped after creating the issue but before saving the thread, the issue's pull request still posts in the mention's thread.

I fixed F2. When a Slack mention is delivered again and its record says the issue was `created` but no reply has gone out yet, the handler now saves the issue's thread before posting the reply and marking the mention `replied`. So if the first attempt stopped after creating the issue but before saving the thread, the issue's pull request still posts in the mention's thread.

**Change** (`packages/plugins/slack/mentions.ts`, in `handleSlackEvent`'s `created` recovery branch): the handler first checks with `findThread` whether the issue already has a thread. If not, it saves the mention's thread with `rememberThread`, then replies. If a thread is already saved, it is left alone. That covers the case where app mode started a new thread because the original first message was deleted.

**Regression test** (`packages/plugins/test/slackApp.test.ts`, in the existing reply-retry test): the first attempt is made to fail on the thread write, right after the `created` record is saved, standing in for a handler timeout. The test then checks that:
- there is no thread and no reply after that attempt.
- the retry saves the thread in the mention's channel and thread.
- exactly one issue-link reply is posted.
- a later `pull_request.opened` event for that issue reuses the mention's thread.

With the fix removed, this test fails.

**Verification:** these all pass:
- every plugin suite.
- `packages/core/test/slackPluginEvents.test.ts`.
- `plugins:check` ("5 plugins checked").
- the plugins package typecheck.
- zero-warning lint on the two changed files.

I did not run the full repository suite.

**Other paths with the same assumption:**
- A `replied` record always has its thread saved, because the thread is written before `replied`. It can still lose the thread to the existing 150-thread limit, which is already listed under Limitations.
- An attempt that stops while the mention is still `pending` cannot be recovered this way, because the issue number was never recorded. That is the at-most-one-issue behaviour that was already there, so I left it.

No previews: the change is not visible in the UI.

PR: #3586
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR adds Slack app notifications, thread reuse, and mention-to-issue creation while retaining incoming-webhook delivery. It is merge-ready within the supplied review scope; I found no verified merge blockers.

✅ Restricted issue creation — Repository selection comes from channel mappings, authorization defaults to denying users, and issue labels come exclusively from settings.

✅ Careful retry handling — Mention records distinguish pending creation from confirmed creation, allowing failed replies to resume without recreating issues. Capacity handling preserves records associated with issues.

✅ Relevant coverage — Added tests exercise signed webhook reception, thread reuse, authorization, injection handling, and record capacity. Current-head checks report 24 passed, none failed or pending.

This was a static review of the supplied code and context. No commands were run or files modified.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S4: 🟢 Exercise overlapping deliveries

The new integration test waits for the first delivery to finish before submitting its retry. Consider testing overlapping deliveries through the real runner, including different messages sharing a mention shard. readMention and writeMention perform separate reads and writes, so this would verify the runner’s serialization guarantees. The supplied context does not establish a reachable concurrency defect; this is optional additional coverage.

S5: 🟢 Verify retention across delayed recovery

MENTION_KEEP_MS bounds scheduled retry delays, while mention admission uses the original receivedAt. Consider documenting and testing what happens when delivery recovery is delayed by downtime, pausing, or manual retry beyond that retention period. The supplied excerpts do not establish whether such webhook replay remains possible, so this is a follow-up verification opportunity rather than a demonstrated blocker.

Score

The implementation addresses the objective with substantial targeted coverage and passing current-head checks. Static inspection found no demonstrated defect requiring correction before merge.

Score: 8/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 49s
  • Tokens: 86,438 (85,601 in / 837 out)
  • Cost: $0.77

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix S4 S5

🤖 Review by ProPR

@propr-dev propr-dev Bot removed the ultrafix label Nov 16, 2026
@propr-dev

propr-dev Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

ℹ️ GitHub auto-merge is turned off for this repository, so ProPR merges this PR itself once it is ready (checks passed or no CI configured, and the review goal met).

To let GitHub merge it the moment required checks pass, enable Settings → General → Pull Requests → Allow auto-merge.

@propr-dev
propr-dev Bot merged commit 5e5dd33 into 3542-epic-plugin-system-xu8 Nov 16, 2026
41 checks passed
@propr-dev
propr-dev Bot deleted the 3555/claude-opus-5-5-official-plugin-slack-app-20261116-1521-orr branch November 16, 2026 16:54
@propr-dev propr-dev Bot changed the title 🔨 [3555 by Claude Opus 5.5] Official plugin: Slack app mode (threads per pull request, mention to start a task) [3555 by Claude Opus 5.5] Official plugin: Slack app mode (threads per pull request, mention to start a task) Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants