Skip to content

chore: Disable AI chat when workbenches exist - #4049

Merged
michaeljguarino merged 5 commits into
masterfrom
marcin/prod-5144-disable-ai-chat-when-workbenches-exist
Aug 26, 2026
Merged

chore: Disable AI chat when workbenches exist#4049
michaeljguarino merged 5 commits into
masterfrom
marcin/prod-5144-disable-ai-chat-when-workbenches-exist

Conversation

@maciaszczykm

Copy link
Copy Markdown
Member

Test Plan

Test environment: local

Checklist

  • I have added a meaningful title and summary to convey the impact of this PR to a user.
  • If required, I have updated the Plural documentation accordingly.
  • I have added tests to cover my changes.
  • I have deployed the agent to a test environment and verified that it works as expected (required only when changing agent code).

Plural Flow: console

@linear

linear Bot commented Aug 24, 2026

Copy link
Copy Markdown

PROD-5144

@soffi-ai

soffi-ai Bot commented Aug 24, 2026

Copy link
Copy Markdown
Soffi AI Summary

This PR disables the legacy AI chat/thread experience in the UI when workbenches exist, effectively routing users to the newer Workbench-based AI experience instead of the old chatbot/thread flow.

The core motivation is to progressively sunset the old AI chat interface in favor of Workbenches. When a user has workbenches available, the "Chat threads" tab is hidden from the AI section, the Command Palette's Threads tab is suppressed, the floating ChatbotButton is hidden, and navigating directly to the threads URL redirects to the Workbenches page. All of this is gated on a new useWorkbenchOptions hook (extracted from SendInsightToWorkbench.tsx into its own shared module) that queries whether workbenches exist and exposes a confirmedNoWorkbenches boolean — used across multiple components to gate the legacy chat surface. A complementary useLegacyAiChatEnabled hook is added to centralize this derived state for components like the Chatbot and ChatbotButton. The useWorkbenchOptions hook is also wired into AIContext so it is broadly accessible without prop-drilling.

Commits

Commit Summary
27a8d44 Adds the useWorkbenchOptions hook as a standalone module, extracted and shared across components.
d75e67c Adds the useLegacyAiChatEnabled hook, which combines the aiEnabled flag and confirmedNoWorkbenches check to determine whether the old chat UI should be shown.
6882271 Wires up workbench detection across the UI: hides the 'Chat threads' tab and redirects the threads route to Workbenches when workbenches exist; suppresses the Command Palette Threads tab and ChatbotButton in the same condition.
8d5e0f1 Merge from master to incorporate upstream changes.
8714498 Applies a review suggestion, likely a minor refinement to hook usage or component logic.

Updated: 2026-08-24 14:39 UTC

Deploy in Soffi

@maciaszczykm
maciaszczykm requested a review from a team August 24, 2026 14:25
@maciaszczykm
maciaszczykm marked this pull request as ready for review August 24, 2026 14:25
@maciaszczykm

Copy link
Copy Markdown
Member Author

@greptileai

@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR disables legacy AI chat surfaces when workbenches exist or workbench availability cannot be confirmed.

  • Adds a shared workbench-availability hook with explicit loading, error, and confirmed-empty states.
  • Hides legacy chat navigation, launchers, buttons, and command-palette history unless no workbenches are confirmed.
  • Prevents /ai/threads from rendering while availability loads and redirects when workbenches exist or the query fails.

Confidence Score: 5/5

The PR appears safe to merge.

The previously reported thread-route failure is fixed: loading renders a skeleton instead of the thread outlet, while workbench presence or a query error redirects away, leaving no blocking failure.

Important Files Changed

Filename Overview
assets/src/components/ai/AI.tsx Gates the chat-thread tab and outlet on confirmed workbench absence; the revised loading and redirect handling closes the previously reported fail-open route.
assets/src/components/workbenches/useWorkbenchOptions.ts Centralizes workbench query state and distinguishes confirmed absence from loading and query errors.
assets/src/components/ai/useLegacyAiChatEnabled.ts Combines AI configuration with confirmed workbench absence into a shared legacy-chat capability gate.
assets/src/components/ai/AIContext.tsx Prevents opening legacy chat and closes an existing chat panel when the capability becomes unavailable.
assets/src/components/layout/TopLevelSidePanel.tsx Filters and clears legacy AI panel requests when legacy chat is disabled.
assets/src/components/commandpalette/CommandPalette.tsx Removes thread history navigation and falls back to commands when legacy chat is unavailable.

Reviews (2): Last reviewed commit: "apply review suggestion" | Re-trigger Greptile

Comment thread assets/src/components/ai/AI.tsx Outdated
@maciaszczykm

Copy link
Copy Markdown
Member Author

@greptileai

@maciaszczykm maciaszczykm added the enhancement New feature or request label Aug 25, 2026
@michaeljguarino
michaeljguarino merged commit 2c5eaa5 into master Aug 26, 2026
15 of 17 checks passed
@michaeljguarino
michaeljguarino deleted the marcin/prod-5144-disable-ai-chat-when-workbenches-exist branch August 26, 2026 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants