Skip to content

feat(streaming): stream custom block outputs in chat and Slack - #7576

Open
TheodoreSpeaks wants to merge 2 commits into
stagingfrom
feat/slack-stream-cross-workspace
Open

feat(streaming): stream custom block outputs in chat and Slack#7576
TheodoreSpeaks wants to merge 2 commits into
stagingfrom
feat/slack-stream-cross-workspace

Conversation

@TheodoreSpeaks

@TheodoreSpeaks TheodoreSpeaks commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Publish custom-block text outputs as live fields and select them in deployed chat and Slack without changing output references.
  • Forward selected answer text while keeping child metadata private; track fields and invocations separately and settle Slack responses when the custom block finishes.
  • Negotiate field-scoped retractions so older streaming clients keep receiving settled text.

Type of Change

  • New feature

Testing

Targeted streaming tests, including provider cancellation, workspace type checks, full lint, all 46 repository audits, docs manifest, and migration safety checks passed. Drizzle reports no SQL changes. Live Slack delivery was not exercised.

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 (CLA)

@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 8, 2026 1:20am UTC

Request Review

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@TheodoreSpeaks I have started the AI code review. It will take a few minutes to complete.

@greptile-apps

greptile-apps Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR enables publisher-selected custom-block text outputs to stream through deployed chat and Slack while preserving output references and keeping child workflow metadata private.

  • Adds live-output configuration, validation, and deployment-picker metadata for custom blocks.
  • Projects selected child answer streams across the custom-block boundary with field- and invocation-scoped identities.
  • Negotiates scoped retractions in chat and settles streamed Slack messages when the enclosing custom block completes.
  • Cancels an active provider stream immediately when required downstream delivery fails.
  • Documents the custom-block streaming model and protocol capability.

Confidence Score: 5/5

The PR appears safe to merge; no actionable new defects remain, and the previously reported provider-cancellation issue was manually resolved after the source-cancellation fix.

Required stream-delivery failures now abort the provider pump without aborting the workflow signal, while the original delivery error still fails the block. The previous finding was manually resolved after TheodoreSpeaks added this behavior and its regression coverage.

Important Files Changed

Filename Overview
apps/sim/executor/handlers/workflow/workflow-handler.ts Validates and projects selected custom-block text streams while filtering private child events and metadata.
apps/sim/executor/execution/block-executor.ts Aborts the provider pump when required stream delivery fails and preserves the original delivery error.
apps/sim/lib/webhooks/slack-execution-stream.ts Tracks custom-block field streams by invocation and settles Slack tasks on block completion, failure, or cancellation.
apps/sim/lib/workflows/streaming/custom-block-output.ts Defines validation and selection behavior for publisher-authorized live custom-block outputs.
apps/sim/lib/workflows/streaming/streaming.ts Adds field-scoped stream identity and compatibility handling for clients that do not negotiate retractions.
apps/sim/app/(interfaces)/chat/hooks/use-chat-streaming.ts Keys streamed text and retractions by stream identity so sibling fields and repeated invocations remain independent.

Sequence Diagram

sequenceDiagram
    participant Source as Source workflow
    participant Custom as Custom block boundary
    participant Consumer as Consumer workflow
    participant Client as Chat or Slack

    Source->>Custom: Selected answer text stream
    Custom->>Custom: Filter private thinking, tools, and metadata
    Custom->>Consumer: Public field stream with streamId
    Consumer->>Client: Stream selected output
    alt Chat with scoped-output-v1
        Client->>Client: Apply field-scoped chunks and retractions
    else Slack
        Client->>Client: Stream settled final-turn text
        Custom-->>Client: Settle when custom block completes
    end
    alt Delivery fails
        Consumer-->>Source: Cancel provider pump
        Consumer-->>Client: Report delivery failure
    end
Loading

Reviews (2): Last reviewed commit: "fix(streaming): cancel generation when s..." | Re-trigger Greptile

Comment thread apps/sim/executor/handlers/workflow/workflow-handler.ts
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@TheodoreSpeaks I have started the AI code review. It will take a few minutes to complete.

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