Skip to content

feat(slack): add agent sessions and streaming - #7296

Merged
TheodoreSpeaks merged 7 commits into
stagingfrom
feat/slack-agent-apis
Sep 1, 2026
Merged

feat(slack): add agent sessions and streaming#7296
TheodoreSpeaks merged 7 commits into
stagingfrom
feat/slack-agent-apis

Conversation

@TheodoreSpeaks

@TheodoreSpeaks TheodoreSpeaks commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add the complete Slack Agent Session and streaming tool surface for custom bots
  • enable Agent View actions and suggested prompts in the custom Slack wizard, including the required agent scopes and im:write, without expanding native Sim OAuth scopes
  • let custom Slack triggers select workflow block outputs to stream immediately into the originating Slack thread, with a configurable response label and deployed-chat tool names
  • normalize assistant thread payloads and map agent_session_stopped events to cancellation of every workflow execution associated with that Slack session

Type of Change

  • New feature

Testing

  • 195 focused Slack trigger, ingress, transport, streaming, and compatibility tests
  • bun run lint
  • bun run type-check
  • 40 repository audits, including generated docs, tool metadata, tool registry boundary, tool request boundary, and strict API validation

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement

@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Sep 1, 2026 1:54am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds Slack Agent Session support and streams selected workflow outputs back into originating Slack conversations. The follow-up fixes preserve legacy suggested-prompt workflows and subscribe custom bots to the selectable assistant-thread events.

  • Adds Agent Session tools, event normalization, cancellation handling, and Slack response streaming.
  • Adds custom-bot Agent View configuration, required scopes, suggested prompts, and workflow-output selection.
  • Preserves legacy OAuth suggested-prompt execution through the compatibility tool.
  • Adds focused coverage across Slack ingress, manifests, credentials, streaming, and tool behavior.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/blocks/blocks/slack.ts Adds Agent Session operations while routing persisted OAuth suggested-prompt blocks through the compatible legacy tool and parameter shape.
apps/sim/triggers/slack/capabilities.ts Extends custom-bot manifests with Agent View configuration, scopes, and subscriptions for all exposed assistant-thread events.
apps/sim/lib/webhooks/slack-execution-stream.ts Implements delivery of selected workflow outputs into the originating Slack conversation.
apps/sim/lib/webhooks/slack-custom-ingress.ts Normalizes custom Slack events and associates stopped Agent Sessions with workflow cancellation.
apps/sim/app/api/webhooks/slack/custom/[credentialId]/route.ts Processes Agent Session stop handling alongside normal verified custom-bot dispatch.
apps/sim/app/workspace/[workspaceId]/integrations/components/connect-slack-bot-modal/connect-slack-bot-modal.tsx Adds custom-bot Agent View actions, suggested prompts, validation, and manifest generation to the setup wizard.

Sequence Diagram

sequenceDiagram
  participant S as Slack
  participant I as Custom bot ingress
  participant W as Workflow execution
  participant R as Slack response stream
  S->>I: Message or assistant event
  I->>W: Dispatch matching trigger
  W->>R: Stream selected block outputs
  R-->>S: Update originating conversation
  S->>I: agent_session_stopped
  I->>W: Cancel associated executions
Loading

Reviews (6): Last reviewed commit: "fix(slack): finalize agent session strea..." | Re-trigger Greptile

Comment thread apps/sim/blocks/blocks/slack.ts
Comment thread apps/sim/triggers/slack/capabilities.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 34 files

Tip: instead of fixing issues one by one fix them all with cubic
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

Comment thread apps/sim/tools/slack/start_stream_v2.ts Outdated
Comment thread apps/sim/blocks/blocks/slack.ts
Comment thread apps/sim/triggers/slack/capabilities.ts
Comment thread apps/sim/blocks/blocks/slack.ts Outdated
Comment thread apps/sim/lib/oauth/utils.ts Outdated
Comment thread apps/sim/tools/slack/set_agent_session_status_v2.ts Outdated
Comment thread apps/docs/content/docs/integrations/slack.mdx Outdated
Comment thread apps/sim/triggers/slack/capabilities.ts Outdated
Comment thread apps/sim/triggers/slack/capabilities.ts
Comment thread apps/docs/content/docs/integrations/slack.mdx Outdated
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

Comment thread apps/sim/blocks/blocks/slack.ts Outdated
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks
TheodoreSpeaks merged commit 2173a70 into staging Sep 1, 2026
26 checks passed
@TheodoreSpeaks
TheodoreSpeaks deleted the feat/slack-agent-apis branch September 1, 2026 02:07
Sg312 added a commit that referenced this pull request Sep 1, 2026
…ector resolution

Rebasing onto origin/staging carried staging's lib/copilot work into our
renamed lib/mothership files via rename detection; this finishes what the
replay left incomplete:

- Complete the #7151 port: cancel_workflow_run handler + registration on
  the mothership executor (types, tests, and catalog entry had already
  rename-followed in).
- pickRunBlockOutputs awaits the now-async resolveOutputIds (#7346 made
  selector resolution child-workflow-aware) and re-imports isValidUuid.
- Slack execution stream + tool-call-lifecycle import getToolDisplayTitle
  from the mothership tool-display module (#7296 semantics kept).
- Resolve leftover conflict markers from the first replay's failed batch
  checkout (browser-tool hardening #7311, YAML bounds #7319 kept).
- Drop the obsolete lib/mothership/tools/server/blocks scan root: the
  block-metadata tool died in the dead-code sweep; blocks reads flow
  through the already-guarded v2 blocks routes.
- Regenerate OpenAPI, CLI API, and CLI docs from the merged contracts.

Claude-Session: https://claude.ai/code/session_01CgaxNAaeD3taGdghbXn17w
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant