Skip to content

fix(slack): recover context for orphan task updates - #30635

Open
Choquer-agency wants to merge 1 commit into
NousResearch:mainfrom
Choquer-agency:fix/slack-orphan-task-context
Open

fix(slack): recover context for orphan task updates#30635
Choquer-agency wants to merge 1 commit into
NousResearch:mainfrom
Choquer-agency:fix/slack-orphan-task-context

Conversation

@Choquer-agency

Copy link
Copy Markdown

Summary

  • Detect short top-level Slack updates that likely refer to a task/thread, like "she paid".
  • Fetch recent channel context and nearby thread context before passing the message to the agent.
  • Instruct the agent to ask a grounded confirmation instead of updating tickets from ambiguous pronouns.

Test Plan

  • ./venv/bin/python -m pytest tests/gateway/test_slack.py::TestSlackOrphanContextUpdates tests/gateway/test_slack_mention.py::test_config_bridges_slack_reply_in_thread -q
  • ./venv/bin/python -m py_compile gateway/platforms/slack.py tests/gateway/test_slack.py

@alt-glitch alt-glitch added type/feature New feature or request P2 Medium — degraded but workaround exists platform/slack Slack app adapter comp/gateway Gateway runner, session dispatch, delivery labels May 22, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for identifying the lost-context case. The premise still holds on current main: top-level DMs are keyed to their own ts at plugins/platforms/slack/adapter.py:2781-2784, while context recovery currently runs only for actual thread replies at plugins/platforms/slack/adapter.py:2886-2900.

Problems

  • The PR edits gateway/platforms/slack.py, which was moved to plugins/platforms/slack/adapter.py by 5600105478ff; this requires a port, not a clean cherry-pick.
  • The new renderer would inject recent historical messages without the current [unverified] sender tagging and guidance used by _fetch_thread_context at plugins/platforms/slack/adapter.py:3803-3839.

Suggested changes

  • Port the feature into the bundled Slack plugin and populate MessageEvent.channel_context at plugins/platforms/slack/adapter.py:3214-3226; gateway/run.py:10391-10395 already consumes that field in the intended order.
  • Reuse the current authorization/tagging behavior for every recovered historical message and test an unauthorized sender.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 13, 2026
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 P2 Medium — degraded but workaround exists platform/slack Slack app adapter sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants