fix(desktop): gate the Superset chat agent choice behind the chat-v3 flag

Merged
SA
2mo ago
+18-9

What

Shows the built-in Superset chat entry in workspace/automation agent pickers only when the chat-v3 PostHog flag is on, matching how the ChatV3 pane is gated. Everyone else no longer sees an entry that errors on launch.

Why

Selecting Superset has failed at dispatch with No host agent config matching 'superset' since #6461 deleted the chat branch from agents.run (a known consequence of that removal). Rather than deleting the entry outright, it now rides the same flag as the rest of chat-v3, since that audience is its eventual consumer.

How

  • useV2AgentChoices appends SUPERSET_AGENT only when useFeatureFlagEnabled(FEATURE_FLAGS.CHAT_V3) — the hook is the single place the entry is injected; every desktop picker consumes it. Mobile and the CLI build their lists from host agentConfigs.list, which never seeds superset.
  • AutomationBody's "agent missing" warning used hostAgents.length > 1 as a loading sentinel, which relied on the entry always being present. It now uses the hook's isFetched plus a non-empty list.

Note: the flag gates visibility only — selecting the entry still errors at dispatch until it's wired to open a ChatV3 pane (follow-up).

Verified: desktop typecheck, full desktop test suite (2842 pass), repo lint.

https://claude.ai/code/session_01BU6ydkrZ2vYKKR9HQhryyf


Summary by cubic

Gate the Superset chat agent in desktop pickers behind the chat-v3 flag to match ChatV3 gating and avoid showing an option that currently errors on launch.

  • useV2AgentChoices appends SUPERSET_AGENT only when useFeatureFlagEnabled(FEATURE_FLAGS.CHAT_V3) from posthog-js/react and @superset/shared/constants.
  • Updates AutomationBody: "agent missing" now checks the hook’s isFetched plus a non-empty list, instead of relying on a always-present Superset entry.
  • Scope: desktop only; mobile and CLI build from host agentConfigs.list and never include Superset.
  • Known limitation: this gates visibility only; selecting Superset still errors until wired to open the ChatV3 pane.

Summary by CodeRabbit

  • New Features

    • Superset agent options now appear only when Chat V3 is enabled.
  • Bug Fixes

    • Improved automation agent validation after the available agent list finishes loading.
    • Corrected missing-agent warnings to accurately identify when an automation’s configured agent is unavailable.