Skip to content

cleanup(slack): Seer Explorer Slack integration improvements#111432

Draft
alexsohn1126 wants to merge 309 commits intomasterfrom
alexsohn/seer-explorer-slack-integration-cleanup
Draft

cleanup(slack): Seer Explorer Slack integration improvements#111432
alexsohn1126 wants to merge 309 commits intomasterfrom
alexsohn/seer-explorer-slack-integration-cleanup

Conversation

@alexsohn1126
Copy link
Copy Markdown
Member

@alexsohn1126 alexsohn1126 commented Mar 24, 2026

Summary

  • Add loading messages for the Seer thinking state in Slack assistant threads
  • Fix bug where explorer completion could send an error string wrapped in a success response (SeerExplorerResponse instead of SeerExplorerError) - pointed out in previous PR
  • Refactor on_app_mention to create SlackIntegration early and use its cached organization property, eliminating a redundant get_organization_by_id RPC call (as pointed out by @GabeVillalobos 🙏)

alexsohn1126 and others added 30 commits March 11, 2026 15:07
…ebhook-endpoint' into alexsohn/iswf-2019-create-slackmentionhandler-for-parsing-atmentions
…ng-atmentions' into alexsohn/iswf-2021-add-explorer-support-to-slackentrypoint
…int' into alexsohn/iswf-2022-add-trigger-explorer-method-to-seeroperator
…perator' into alexsohn/iswf-2023-add-taskbroker-task-for-processing-slack-explorer-mentions
Replace raw string halt reasons with a StrEnum for type safety
and consistency with ProcessMentionHaltReason in tasks.py.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…mpletion-hook-payloads' into alexsohn/iswf-2025-add-explorer-notification-data-and-slack-renderer
…lack-renderer' into alexsohn/iswf-2018-handle-app-mention-events-in-slack-webhook-endpoint
…ebhook-endpoint' into alexsohn/iswf-2019-create-slackmentionhandler-for-parsing-atmentions
…ng-atmentions' into alexsohn/iswf-2021-add-explorer-support-to-slackentrypoint
…int' into alexsohn/iswf-2022-add-trigger-explorer-method-to-seeroperator
…perator' into alexsohn/iswf-2023-add-taskbroker-task-for-processing-slack-explorer-mentions
Make the example_data summary less specific to match the fallback text
used in the Slack renderer. This is only used for debug previews.

Co-Authored-By: Claude Opus 4.6 <noreply@example.com>
…lack-renderer' into alexsohn/iswf-2018-handle-app-mention-events-in-slack-webhook-endpoint
…ebhook-endpoint' into alexsohn/iswf-2019-create-slackmentionhandler-for-parsing-atmentions
…ng-atmentions' into alexsohn/iswf-2021-add-explorer-support-to-slackentrypoint
…int' into alexsohn/iswf-2022-add-trigger-explorer-method-to-seeroperator
…perator' into alexsohn/iswf-2023-add-taskbroker-task-for-processing-slack-explorer-mentions
The on_app_mention handler fetches orgs via get_organization_by_id which returns orgs regardless of visibility status. Add a check to bail out early when the org is not active (e.g. pending deletion or deletion in progress). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ebhook-endpoint' into alexsohn/iswf-2019-create-slackmentionhandler-for-parsing-atmentions
…ng-atmentions' into alexsohn/iswf-2021-add-explorer-support-to-slackentrypoint
…int' into alexsohn/iswf-2022-add-trigger-explorer-method-to-seeroperator
…perator' into alexsohn/iswf-2023-add-taskbroker-task-for-processing-slack-explorer-mentions
…ack renderer

Move Explorer error notification types to this branch (iswf-2025) to
colocate with the other Explorer notification types rather than having
them introduced in iswf-2021.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…lack-renderer' into alexsohn/iswf-2018-handle-app-mention-events-in-slack-webhook-endpoint
…ebhook-endpoint' into alexsohn/iswf-2019-create-slackmentionhandler-for-parsing-atmentions
…ng-atmentions' into alexsohn/iswf-2021-add-explorer-support-to-slackentrypoint
…int' into alexsohn/iswf-2022-add-trigger-explorer-method-to-seeroperator
…perator' into alexsohn/iswf-2023-add-taskbroker-task-for-processing-slack-explorer-mentions

# Conflicts:
#	src/sentry/integrations/slack/webhooks/event.py
alexsohn1126 and others added 8 commits March 25, 2026 15:18
Replace the silent exception swallow with a logger.exception call
when assistant_threads_setStatus fails, providing integration_id,
channel_id, and thread_ts for debugging.

Co-Authored-By: Claude Opus 4.6 <noreply@example.com>
… task

Switch from record_halt to record_failure for conditions that indicate
genuine failures (org not found, no explorer access, setup errors,
unlinked identity) so they are properly surfaced for debugging. Also
move the record call before the link identity prompt send.

Co-Authored-By: Claude Opus 4.6 <noreply@example.com>
Add slack_request.user_id to the existing event data validation check
so missing user IDs halt early instead of passing an empty string to
the async task, which would incorrectly prompt identity linking.

Rename MISSING_CHANNEL_OR_TEXT to MISSING_EVENT_DATA to reflect the
broader scope of the check.

Co-Authored-By: Claude Opus 4.6 <noreply@example.com>
Rename ProcessMentionHaltReason to ProcessMentionFailureReason and
switch assert_halt_metric to assert_failure_metric in tests so they
match the record_failure calls in the task code.

Co-Authored-By: Claude Opus 4.6 <noreply@example.com>
…perator' into alexsohn/iswf-2023-add-taskbroker-task-for-processing-slack-explorer-mentions
…lack-explorer-mentions' into alexsohn/seer-explorer-slack-integration-cleanup
alexsohn1126 and others added 3 commits March 26, 2026 09:50
The return is intentional: run_id is globally unique in Seer, so only one entrypoint will ever have a cache entry per run. An org mismatch is anomalous and should abort the entire method.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…lack-explorer-mentions' into alexsohn/seer-explorer-slack-integration-cleanup
alexsohn1126 and others added 5 commits March 26, 2026 13:06
Replace SlackPromptLinkMessageBuilder with a SlackRenderable built from
slack_sdk block objects, matching the interface expected by
send_threaded_ephemeral_message. Extract the renderable construction
into _build_link_identity_renderable for reuse and testability.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace SlackPromptLinkMessageBuilder with a SlackRenderable built from
slack_sdk block objects, matching the interface expected by
send_threaded_ephemeral_message. Extract the renderable construction
into _build_link_identity_renderable for reuse and testability.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The custom message parameter is no longer needed since the link
identity prompt now uses SlackRenderable directly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The custom message parameter is no longer needed since the link
identity prompt now uses SlackRenderable directly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
alexsohn1126 and others added 2 commits March 26, 2026 14:12
Move the ephemeral link-identity prompt to fire before clearing the
thread status indicator. Remove the thread_ts parameter from
_send_link_identity_prompt so the prompt is sent as a top-level
ephemeral message rather than threaded.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…lack-explorer-mentions' into alexsohn/seer-explorer-slack-integration-cleanup
alexsohn1126 and others added 3 commits March 30, 2026 10:14
… context

Instead of relying solely on the plain `text` field, thread context
parsing now prefers Block Kit `blocks` and extracts links with URLs,
user mentions, channel refs, emojis, and broadcasts. Falls back to
`text` when blocks are absent or empty.
…mention context

Pass ts and thread_ts separately from the webhook handler so the task
knows whether the mention was top-level or in a thread. The ephemeral
identity-linking prompt now appears in the thread when mentioned in a
thread, or at the channel level for top-level mentions.
…lack-explorer-mentions' into alexsohn/seer-explorer-slack-integration-cleanup
Base automatically changed from alexsohn/iswf-2023-add-taskbroker-task-for-processing-slack-explorer-mentions to master March 31, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant