Skip to content

fix(slack): clear stuck assistant status on /stop and resume typing after clarify - #64621

Merged
teknium1 merged 3 commits into
mainfrom
fix/slack-status-lifecycle-gaps
Jul 15, 2026
Merged

teknium1 merged 3 commits into
mainfrom
fix/slack-status-lifecycle-gaps

Conversation

@teknium1

Copy link
Copy Markdown
Collaborator

Summary

Slack's persistent assistant status ("is thinking...") can no longer get stuck with no way to dismiss it, and the typing indicator resumes after a user answers a clarify prompt. Salvages the two halves of #32340 (@LeonSGP43) and #62248 (@KCAYAAI) that survived the #63709 Agent View merge, adapted to the new workspace-scoped status tracking. Closes #32295.

Root cause

Two lifecycle gaps remained after #63709:

  1. /stop with no running agent returned "no active task" without touching the platform status indicator — the exact stuck-status scenario in Slack: "is thinking..." status indicator gets stuck when agent ends without sending a reply #32295 (status set by a turn that died without a final send, or by a previous gateway process). Compounding it, stop_typing only cleared statuses present in the in-memory tracking map, so a status surviving a gateway restart was permanently unclearable.
  2. The clarify prompt path pauses the typing indicator so Slack users can type an answer, but the clarify text-response interception never resumed it — the indicator stayed dead until the 3-minute heartbeat. (/approve already resumed; clarify was the asymmetric path.)

Changes

  • gateway/slash_commands.py: /stop's no-active-agent branch now best-effort clears the platform status indicator via _stop_typing_with_metadata, with thread/workspace routing metadata.
  • plugins/platforms/slack/adapter.py: stop_typing with explicit thread metadata clears the status even when the tracking map has no entry (restart/eviction). The fallback is skipped when multiple Slack Connect workspaces track the same channel+thread and no team_id is given — fix(slack): complete Agent View workspace routing #63709's cross-workspace safety guarantee is preserved.
  • gateway/run.py: clarify text-response interception calls resume_typing_for_chat so the resumed agent's indicator comes back immediately (cherry-picked from fix(slack): harden Assistant status lifecycle #62248, @KCAYAAI's authorship preserved).
  • Tests: untracked-clear, ambiguous-workspace guard, /stop no-active clear + failure tolerance, clarify resume.

Validation

Before After
/stop with stuck status, no agent status stays forever cleared
stop_typing after gateway restart unclearable cleared via explicit metadata
Ambiguous Slack Connect channel, no team_id n/a refuses to guess (unchanged guarantee)
Typing after clarify answer silent ~3 min resumes immediately

Targeted suites green: test_stop_thread_sibling.py, test_slack.py, test_clarify_active_session_bypass.py — 252 tests, 0 failed. E2E: real adapter + real _handle_stop_command exercised against all four scenarios with an isolated HERMES_HOME.

Contributor commits cherry-picked with authorship preserved; rebase-merge required.

Infographic

Slack status lifecycle gap closure

KCAYAAI and others added 3 commits July 14, 2026 14:19
…tadata

Salvaged from #32340 by @LeonSGP43, adapted to the workspace-scoped
status tracking that landed in #63709:

- /stop with no running agent now best-effort clears the platform
  status indicator, so a phantom 'is thinking...' left by a gateway
  restart or a turn that died without a final send can always be
  dismissed (#32295).
- SlackAdapter.stop_typing clears an untracked thread when the caller
  names it explicitly in metadata — clearing an unset status is a
  harmless no-op on Slack's side. The fallback is skipped when multiple
  Slack Connect workspaces track the same channel+thread and no team_id
  is given, preserving #63709's cross-workspace safety guarantee.
@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery comp/plugins Plugin system and bundled plugins platform/slack Slack app adapter sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages P2 Medium — degraded but workaround exists labels Jul 14, 2026
@teknium1
teknium1 merged commit e357b69 into main Jul 15, 2026
31 checks passed
@teknium1
teknium1 deleted the fix/slack-status-lifecycle-gaps branch July 15, 2026 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery comp/plugins Plugin system and bundled plugins P2 Medium — degraded but workaround exists platform/slack Slack app adapter sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slack: "is thinking..." status indicator gets stuck when agent ends without sending a reply

4 participants