Skip to content

fix(slack): restore status across Agent and Assistant API modes - #115398

Open
js37523 wants to merge 1 commit into
NousResearch:mainfrom
js37523:hannes/slack-status-fallback-upstream
Open

js37523 wants to merge 1 commit into
NousResearch:mainfrom
js37523:hannes/slack-status-fallback-upstream

Conversation

@js37523

@js37523 js37523 commented Sep 18, 2026

Copy link
Copy Markdown

Summary

Fixes the Slack working-status regression reported in #110374 across both Slack API modes.

  • Sends processing while working and active when clearing through agents.sessions.setStatus.
  • Falls back to the legacy free-text assistant.threads.setStatus only when Slack rejects the Agent Sessions endpoint.
  • Remembers that rejection per workspace, avoiding repeated failed calls without degrading other workspaces served by the same adapter.
  • Does not retry transient transport failures through the legacy endpoint, preventing duplicate writes.
  • Keeps agents.sessions.rename unchanged for thread titles.
  • Updates Slack documentation, changelog, package version, and lockfile.

Why this differs from the existing alternatives

Existing PRs for #110374 generally choose either enum-only Agent Sessions status or legacy-only free-text status. This PR combines the compatible parts:

  1. Prefer Slack's new Agent Sessions lifecycle contract when it works.
  2. Preserve legacy Assistant-view installations by degrading only after a recognized server-side rejection.
  3. Scope degradation per workspace and remember it for the process lifetime.

Root cause

Hermes selected agents.sessions.setStatus when slack-sdk 3.44+ exposed the typed method, but continued sending legacy free-text phrases and an empty string. The new endpoint accepts only active | processing | suspended | closed; Slack returned invalid_arguments, which the adapter logged only at DEBUG.

Validation

  • RED before implementation: focused routing suite reported 4 failures and 3 passes.
  • GREEN after implementation: scripts/run_tests.sh tests/gateway/test_slack.py -q — 251 passed.
  • uv lock --check — passed.
  • Python compile checks — passed.
  • Ruff (when installed) — passed.
  • git diff --check — passed.
  • Static security scan — no hardcoded secrets, shell injection, eval/exec, pickle, or SQL-formatting findings.
  • Independent fail-closed review — passed with no security concerns, logic errors, or suggestions.

Live Slack API verification

Against the affected real workspace/thread:

  • agents.sessions.setStatus(status="processing") → success
  • agents.sessions.setStatus(status="active") → success
  • assistant.threads.setStatus(status="is testing the working indicator...") → success
  • assistant.threads.setStatus(status="") → success

Related work

This is a hybrid compatibility alternative to #109914, #110389, #110391, #111820, and #113698. It incorporates the enum contract while retaining a bounded, per-workspace legacy fallback for rejected Agent Sessions installations.

@js37523
js37523 requested a review from a team September 18, 2026 20:55
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have 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 labels Sep 18, 2026
@whyyagswhy

Copy link
Copy Markdown

Independent verification on the PR head (c5eee06): slack suite 250/250 green (1 skipped) on Linux. No findings.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have 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.

3 participants