Skip to content

fix(slack): preserve text order around tool progress - #7716

Merged
TheodoreSpeaks merged 2 commits into
stagingfrom
codex/fix-slack-stream-ordering
Sep 10, 2026
Merged

fix(slack): preserve text order around tool progress#7716
TheodoreSpeaks merged 2 commits into
stagingfrom
codex/fix-slack-stream-ordering

Conversation

@TheodoreSpeaks

@TheodoreSpeaks TheodoreSpeaks commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Flush buffered answer text before starting a visible Slack tool task so progress cards cannot split a sentence.
  • Serialize stream events and wait for pending delivery before finishing. Preparatory and hidden tool events no longer insert paragraph breaks.
  • Keep tool cards at their original text boundaries when secret projection or citation evidence delays delivery; failure cleanup includes only tasks already sent or attempted.

Type of Change

  • Bug fix

Testing

86 focused tests passed, including sentence ordering, concurrent events, deferred secret projection and citations, cancellation, delivery failures, and connection controls. App typecheck, lint, all 46 repository audits, block registry, and docs manifest checks passed. Verified the response and native tool progress order in a live Slack DM.

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 10, 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 10, 2026 5:28am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no actionable new issue or outstanding previous finding remains.

Summary

  • Flushes safe preceding text before delivering a tool task.
  • Defers tasks when secret projection or citation evidence withholds preceding text.
  • Tracks only delivered or attempted tasks for failure cleanup.
  • Adds focused coverage for deferred projection, citations, cancellation, concurrent events, and ambiguous delivery failures.
  • The previously reported progress-overtaking issue is fixed, and its thread was manually resolved.

Diagram

sequenceDiagram
    participant O as Orchestrator
    participant S as SlackSearchAssistantStream
    participant P as Projection
    participant A as Slack API

    O->>S: Assistant text
    S->>S: Buffer text
    O->>S: Visible tool call
    S->>S: Queue task at text boundary
    S->>P: Project preceding text
    alt Prefix is stable and safe
        S->>A: Append preceding text
        S->>A: Append task update
        S->>A: Append following text
    else Secret or citation remains unresolved
        S->>A: Append only safe prefix
        S->>S: Retain queued task
        O->>S: Evidence or completion
        S->>P: Re-project text
        S->>A: Append remainder, task, and later text
    end
Loading

Reviews (2) · Last reviewed commit: "fix(slack): defer task progress behind w..."

Comment thread apps/sim/lib/slack-search/assistant-stream.ts Outdated
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks
TheodoreSpeaks merged commit 1cc4fb1 into staging Sep 10, 2026
32 of 33 checks passed
@waleedlatif1
waleedlatif1 deleted the codex/fix-slack-stream-ordering branch September 10, 2026 08:14
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