feat(seer-slack): Refresh Slack thread status to prevent 2-min auto-clear#112679
Draft
alexsohn1126 wants to merge 15 commits intomasterfrom
Draft
feat(seer-slack): Refresh Slack thread status to prevent 2-min auto-clear#112679alexsohn1126 wants to merge 15 commits intomasterfrom
alexsohn1126 wants to merge 15 commits intomasterfrom
Conversation
Add the assistant:write scope to the Slack integration to enable the bot to act as a Slack Agent, supporting DM-based agent interfaces. Refs ISWF-2388 Co-Authored-By: Claude Opus 4.6 <noreply@example.com>
Extract shared org-resolution logic into _resolve_seer_organization helper and merge on_app_mention/on_dm into a single _handle_seer_mention method. Replace three identical halt reason enums with unified SeerSlackHaltReason. Extract duplicated loading messages list into a module-level constant. Refs ISWF-2388 Co-Authored-By: Claude Opus 4.6 <noreply@example.com>
…nges Update tests to match the refactored _resolve_seer_organization which now iterates org integrations and uses SlackExplorerEntrypoint.has_access instead of checking a single feature flag. Align halt reasons with the consolidated enum values (NO_VALID_INTEGRATION, NO_VALID_ORGANIZATION) and update the has_access test for the seer-slack-explorer flag rename. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Address PR review feedback: - Change SLACK_PROVIDERS from set to list to match the RPC method's expected `list[str]` parameter type, preventing serialization errors - Check org status before calling get_installation to avoid unnecessary queries for inactive orgs - Verify the requesting Slack user belongs to the resolved org when their identity is linked, preventing cross-org data access when multiple orgs share a Slack workspace - Fix inaccurate comments about DM fallback behavior Refs ISWF-2388 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…uests Move identity verification to the start of org resolution so unlinked users receive an ephemeral prompt with a link button instead of silently failing downstream. Introduce SeerResolutionResult TypedDict to replace the tuple-or-None return pattern, add a static ephemeral message helper on SlackIntegration, and simplify DM dispatch by routing assistant-scoped integrations through the mention handler. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…lear Slack's assistant_threads.setStatus auto-clears after 2 minutes of no message. When Seer processing takes longer, the "Thinking..." indicator silently disappears while the user is still waiting for a response. Add a self-chaining Celery task that re-sends the thread status every 90 seconds. After trigger_explorer() returns a run_id, the first refresh is scheduled. Each refresh checks the SeerOperatorExplorerCache — if the cache entry still exists, the run is in progress and the status is refreshed. When the completion hook fires, it deletes the cache before sending the reply, so subsequent refreshes become no-ops. The refresh chain is capped at 6 iterations (~11 min total coverage). The completion hook now also deletes the explorer cache entry after use so the refresh task can detect completion.
Narrow handler signatures from SlackDMRequest to SlackEventRequest for better type safety. Extract channel_id, user_id, and thread_ts properties on SlackEventRequest to handle assistant_thread_started event structure differences in one place. Rename on_app_mention to on_prompt and is_assistant to has_assistant_scope for clarity. Add contextual messaging to the identity link prompt based on event type. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove the ts fallback from SlackEventRequest.thread_ts so top-level messages correctly yield None instead of collapsing into the message ts. Add missing return type annotations to has_assistant_scope and is_assistant_thread_event. Move variable extraction before org resolution in _handle_seer_prompt for earlier lifecycle context.
…rface-for-seer-explorer' into alexsohn/refresh-thinking-status-seer-slack-mentions
Contributor
Backend Test FailuresFailures on
|
Base automatically changed from
leanderrodrigues/iswf-2388-explore-slack-dms-agent-interface-for-seer-explorer
to
master
April 10, 2026 21:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
According to the Slack's set thread status docs, the status only lasts for 2 minutes. For those tasks that take longer than 2 minutes, the status clears, and the user is left confused as of the status of the agent call.
Solution
We will run a delayed task that runs 90 seconds after the initial
setStatus, and will refresh the status as long as the SeerOperatorExplorerCache is alive. Then it will schedule another task 90 seconds out until the refresh limit (6 times) is reached.That also means now we will manually delete the cache in the completion hook when seer agent has completed. Slack's API document states that the status will be automatically cleared once the reply has been received, so we won't need to clear the status manually.
Perhaps there's a more elegant solution to this. Open for ideas
Completes ISWF-2426