Skip to content

fix(slack-search): repair execution, OAuth, and onboarding - #7666

Merged
TheodoreSpeaks merged 6 commits into
stagingfrom
codex/slack-search-ecs-oauth-fixes
Sep 9, 2026
Merged

fix(slack-search): repair execution, OAuth, and onboarding#7666
TheodoreSpeaks merged 6 commits into
stagingfrom
codex/slack-search-ecs-oauth-fixes

Conversation

@TheodoreSpeaks

@TheodoreSpeaks TheodoreSpeaks commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Run Slack Search through the database-backed inline queue in the app process. The generic queue can select Trigger.dev and ignore the local runner, leaving accepted Slack turns waiting for an external worker.
  • Preserve source-authorization callback state until the actual ten-minute deadline or explicit cancellation. Browser isolation can report a live OAuth popup as closed, which previously caused an immediate false expiry and discarded the callback. See MDN's window.open documentation.
  • Allow canceling pending authorization, ignore stale startup responses and deadline callbacks, and preserve a newer attempt's state.
  • Simplify the Search wizard without displaying a manifest preview. New apps open a prefilled Slack creation link; existing apps copy the generated configuration before opening Slack to apply it. Add the Agent View app_home_opened subscription; opening the app does not start a Search turn.
  • Deliver Connect sources prompts with chat.postEphemeral, targeting the requesting Slack user in their DM. After successful delivery, post a plain reply in the question thread explaining that no sources are available and pointing to the private setup prompt. Recheck the installation, worker lease, and cancellation before the thread reply; fail without replaying either message if delivery fails.

Type of Change

  • Bug fix

Testing

  • 111 tests across nine focused suites passed, covering inline execution, popup isolation, state matching, timeout, cancellation, unmount races, and existing Slack authorization/processing behavior.
  • 52 tests across five focused suites passed for wizard entry points, the generated manifest, event filtering, and unified ingress.
  • OAuth changes passed 19 tests. The latest thread-reply change passed 59 onboarding/Assistant/processing tests, covering new and existing threads, ephemeral recipient targeting, authorization and cancellation rechecks, and rejected or ambiguous delivery.
  • Existing-app setup passed 24 tests across two UI suites, including clipboard failure/retry and updating an app shared with Slack sources. All eight UI cleanup passes found no issues.
  • App/auth typechecks, full Biome checks, all 46 audits, block-registry and docs-manifest checks passed.
  • Local preview and the webhook challenge handshake passed through an HTTPS tunnel. Live ephemeral and thread-notice delivery and the execution fix still need Slack smoke testing.

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 9, 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 9, 2026 7:38pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR repairs Slack Search execution and setup behavior.

  • Routes durable Slack Search turns through the application’s inline queue.
  • Keeps managed-user OAuth attempts alive until their deadline while safely handling cancellation, stale callbacks, and unmounts.
  • Adds app_home_opened to the generated Slack manifest without treating that event as a search turn.
  • Sends source-connection prompts privately and posts a thread acknowledgment only after delivery and authorization checks.
  • Restores an actionable manifest-copy flow for existing Slack apps.
  • Updates focused tests for queue selection, onboarding delivery, OAuth races, manifest generation, and setup UX.

Confidence Score: 5/5

The PR appears safe to merge, with no outstanding correctness, security, or repository-rule violations identified.

The existing-app manifest workflow now provides the missing configuration-copy action, and the previously reported OAuth deadline race is guarded by popup identity checks. All previous threads are resolved, including the import-order finding that Greptile conceded as incorrect.

Important Files Changed

Filename Overview
apps/sim/components/integrations/slack-search-setup-wizard.tsx Restores copying and applying generated configuration when updating an existing Slack app.
apps/sim/ee/credential-groups/components/slack-managed-users-modal.tsx Replaces unreliable popup-closure polling with deadline-based OAuth state handling and stale-attempt guards.
apps/sim/lib/knowledge/application/slack-search/onboarding.ts Delivers source setup privately before posting a guarded thread acknowledgment.
apps/sim/lib/slack-search/queue.ts Forces Slack Search jobs through the database-backed inline application runner.
apps/sim/lib/slack-search/manifest.ts Adds the Agent View app-home event subscription to generated Slack manifests.

Sequence Diagram

sequenceDiagram
    participant U as Slack user
    participant S as Slack ingress
    participant Q as Inline queue
    participant W as Slack Search worker
    participant API as Slack API

    U->>S: Search question
    S->>Q: Enqueue durable turn
    Q->>W: Run in app process
    W->>W: Check installation and lease
    alt Sources available
        W->>API: Deliver search response
    else Sources unavailable
        W->>API: Post ephemeral setup prompt to user
        W->>W: Recheck lease, authorization, cancellation
        W->>API: Post acknowledgment in question thread
    end
Loading

Reviews (6): Last reviewed commit: "fix(slack-search): preserve existing app..." | Re-trigger Greptile

@TheodoreSpeaks TheodoreSpeaks changed the title fix(slack-search): run turns inline and preserve OAuth callbacks fix(slack-search): repair execution, OAuth, and app setup Sep 9, 2026
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile-apps please review the latest changes.

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 9, 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.

@TheodoreSpeaks TheodoreSpeaks changed the title fix(slack-search): repair execution, OAuth, and app setup fix(slack-search): repair execution, OAuth, and onboarding Sep 9, 2026
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile-apps please review the latest changes. The OAuth deadline now checks attempt identity; the import-order thread includes evidence from the repository formatter.

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 9, 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.

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile-apps please review the latest revision. The only change since ce354d0 is removal of the Slack Search README.

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 9, 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.

@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 9, 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.

Comment thread apps/sim/components/integrations/slack-search-setup-wizard.tsx Outdated
@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 9, 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.

@TheodoreSpeaks
TheodoreSpeaks merged commit 345bfe2 into staging Sep 9, 2026
34 checks passed
@TheodoreSpeaks
TheodoreSpeaks deleted the codex/slack-search-ecs-oauth-fixes branch September 9, 2026 19:49
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