Skip to content

Slack: chat.startStream fails with team_not_found on Enterprise Grid workspaces #95

Description

@patrick-chinchill

Symptom

chat.startStream fails with team_not_found on Enterprise Grid workspaces, even with a non-empty thread_ts. Observed in chinchill-api production (ray-dev, deploy 594817568):

slack_sdk.errors.SlackApiError: (url: https://slack.com/api/chat.startStream, status: 200)
The server responded with: {'ok': False, 'error': 'team_not_found'}

Traceback reaches SlackAdapter.stream() → super().stream() → streamer.append() → chat.startStream.

Workspace context

  • team_id: T0917KZ3BTK
  • stored_enterprise_id: E0917L87ZCH
  • is_enterprise_install: False
  • Non-streaming chat.postMessage succeeds on the same workspace
  • Only chat.startStream returns team_not_found

Likely root cause

chat.startStream requires an explicit team_id for Grid orgs (the per-workspace token alone isn't sufficient), but the adapter's AsyncWebClient (SlackAdapter._get_client()) is created without one. Non-streaming Web API calls succeed because they don't enforce the same constraint.

Relationship to existing PRs

Suggested fix path (pending verification)

  1. Thread team_id from the streaming context through to the AsyncWebClient call, either:
    • Via the existing recipient_team_id (preferred — already extracted on the inbound path), or
    • Via an explicit team_id parameter on the chat.startStream call
  2. Add a regression test mocking an Enterprise Grid workspace where chat.postMessage succeeds without team_id but chat.startStream requires it.

Workaround in flight

chinchill-api is shipping an interim error-handling fix so a failed final-post on an otherwise-successful streaming run no longer surfaces a false "something went wrong" to the end user. The SDK-side fix is still needed for streaming to actually work on Grid workspaces.

Follow-up

@tony-chinchill-ai offered to attach the full traceback in a follow-up comment. Filed by report-on-PR #89.

Activity

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

    bugSomething isn't workingslack

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions