Skip to content

Prevent passive Slack thread participants from receiving plugin OAuth prompts #1377

Open

Description

@erickreutz

Problem

Junior treats the author of every subscribed Slack reply as the actor for a new turn, even when that person only joined an existing thread to provide context.

This produces a bad OAuth flow in shared threads:

  1. Alice asks Junior to debug an engineering problem.
  2. Junior begins an investigation that uses an authenticated MCP plugin such as PlanetScale.
  3. Bob replies without mentioning Junior and adds support context, an identifier, or a correction.
  4. The subscribed-reply router decides Bob's message continues Junior's work.
  5. Junior starts the turn with Bob as the actor.
  6. When PlanetScale requires authentication, Junior sends Bob an OAuth link.

Bob never requested PlanetScale access, may not have a PlanetScale account, and did not take ownership of the investigation. The original task also stalls waiting for an authorization Bob cannot complete.

Current behavior

SlackTurnRuntime.handleSubscribedMessage assigns the latest message author as the turn actor:

const actorId = isResourceEventNotification
  ? undefined
  : message.author.userId;

MCP authentication then creates and delivers the authorization request for that actor:

userId: input.actorId

The conversation store already preserves the original conversation actor when another Slack user participates, but the subscribed-turn runtime does not use that distinction.

Plugin manifests also have no audience or eligibility configuration. Every actor can reach every plugin's OAuth flow if the model selects its tools.

Expected behavior

Posting a passive reply in a subscribed thread must not implicitly make someone the task authority or credential principal.

  • A cross-actor reply without an explicit Junior mention may contribute context to the existing task.
  • It must not trigger an OAuth link for its author.
  • It must not authorize new work or broaden the original task.
  • Junior may continue using the task owner's authority only within the work that owner already requested.
  • If attribution is ambiguous, Junior should wait for the task owner instead of asking the incidental participant to authenticate.
  • An explicit mention from another actor may start a separate turn under that actor's credentials.
  • Junior must never reuse the task owner's credentials for a new request from another participant.

Reproduction

  1. Alice mentions Junior in a Slack thread and requests an investigation that requires an MCP plugin.
  2. Alice has authorized the plugin.
  3. Allow the initial turn to complete or pause.
  4. Bob replies in the same thread without mentioning Junior.
  5. Make Bob's reply a natural continuation, such as supplying the requested record ID.
  6. Observe Junior send Bob the plugin OAuth link.

Acceptance

  • Passive cross-actor subscribed replies never send their author an OAuth link.
  • The message remains available as attributed conversation context.
  • Existing task authority and credential ownership do not silently change.
  • Explicit cross-actor mentions remain separate actor-owned turns.
  • Tests cover both active and idle subscribed conversations.

Related

Activity

  1. dcramer commented on Aug 10, 2026

    @dcramer
    Member

    hrm not totally sure how we should address this, but i agree the UX sucks. need to put some thought into it

  2. sentry-junior commented on Aug 11, 2026

    @sentry-junior
    Contributor

    Refined intent

    Provider availability must follow the current turn actor, not the conversation as a whole.

    • A provider previously connected by the current actor may be restored for that actor's later turn.
    • A provider connected by another actor must not be restored for the current actor.
    • If the current actor later calls a tool that needs an unconnected provider, Junior may start that actor's authorization flow at that point.
    • Provider history alone must not cause an authorization prompt before the current request needs that provider.
    • A passive cross-actor reply may add attributed context. It must not change the actor, credential subject, or authorization recipient.
    • An explicit cross-actor request is a new actor-owned turn. It must not inherit another actor's provider connection or credentials.

    Test-first design requirement

    Prove the user experience before selecting the technical design. Prefer integration tests through real Junior wiring. Fake only the external provider and Slack HTTP edges. Use smaller tests only for local projection or selection rules that cannot be proved clearly at the integration layer.

    Map and test the common flows for both auth systems:

    MCP providers

    • Same actor, same turn resume: restore the provider and continue without another prompt when credentials exist.
    • Same actor, later turn: restore that actor's provider connection; request auth only if the provider reports that credentials are missing or expired.
    • Different actor, explicit request: do not restore the prior actor's provider connection; request auth only if the new actor calls a tool from that provider.
    • Different actor, passive reply: preserve the message as context without changing authority or sending an auth prompt.
    • Unrelated request after prior MCP use: do not connect or prompt for the prior provider.
    • New actor intentionally calls an MCP tool: connect under that actor and deliver any required auth prompt to that actor.

    Non-MCP plugin auth

    • Same actor with a valid stored token: use it without prompting.
    • Same actor with a missing, expired, or rejected token: prompt only when the requested plugin operation needs it.
    • Different actor: never use or infer the prior actor's token; prompt the current actor only when their requested operation needs it.
    • Passive cross-actor reply: do not run a new actor-owned plugin authorization flow.
    • Unrelated request after prior plugin use: do not prompt because the plugin appeared in conversation history.

    For each flow, assert the visible Slack result, authorization recipient, actor and credential subject, provider activation, pending-auth state, turn outcome, and ability to process the next message. First run the tests against current behavior to identify the exact failing contracts. Then design the smallest actor-scoped provider projection and restore path that makes those tests pass.

    Current evidence: mcp_provider_connected stores only the provider at conversation scope, while provider restore consumes conversation events, prior Pi tool history, and restored skills. Reply execution binds credentials to the current message actor. That allows one actor's provider history to be replayed under another actor and can trigger an unrelated auth prompt.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions