Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
feat: go to anything check enable skill (#41281)
wangxiaoleic937fcb21abb
diff --git a/web/app/components/goto-anything/__tests__/index.spec.tsx b/web/app/components/goto-anything/__tests__/index.spec.tsxindex a874c84564a..fd39b7713cf 100644--- a/web/app/components/goto-anything/__tests__/index.spec.tsx+++ b/web/app/components/goto-anything/__tests__/index.spec.tsx@@ -1,5 +1,6 @@import type { ReactNode } from 'react'import type { ActionItem, SearchResult } from '../actions/types'+import type { ProviderContextState } from '@/context/provider-context'import { DialogTrigger } from '@langgenius/dify-ui/dialog'import { detectPlatform } from '@tanstack/react-hotkeys'import { fireEvent, render, screen, waitFor } from '@testing-library/react'@@ -125,6 +126,7 @@ const visibilityState = vi.hoisted(() => ({agentEnabled: true,canManageAgents: true,datasetOperator: false,+ enableSkill: true,}))vi.mock('jotai', async (importOriginal) => {@@ -142,6 +144,13 @@ vi.mock('@/features/agent-v2/feature-flag', () => ({vi.mock('@/features/agent-v2/permissions', () => ({useCanManageAgents: () => visibilityState.canManageAgents,}))++vi.mock('@/context/provider-context', () => ({+ useProviderContextSelector: vi.fn((selector: (state: Partial<ProviderContextState>) => unknown) =>+ selector({ enableSkill: visibilityState.enableSkill }),+ ),+}))+vi.mock('@/app/components/plugins/install-plugin/hooks/use-workspace-plugin-install-permission',() => ({@@ -261,6 +270,7 @@ describe('GotoAnything', () => {visibilityState.agentEnabled = truevisibilityState.canManageAgents = truevisibilityState.datasetOperator = false+ visibilityState.enableSkill = truemockFindCommand = nullmockAvailableCommands = []actionsMock.slash.search.mockReset()@@ -404,9 +414,26 @@ describe('GotoAnything', () => {describe('search functionality', () => {it.each([- [{ agentEnabled: true, canManageAgents: true, datasetOperator: false }, true, true],- [{ agentEnabled: false, canManageAgents: true, datasetOperator: false }, false, true],- [{ agentEnabled: true, canManageAgents: false, datasetOperator: true }, false, false],+ [+ { agentEnabled: true, canManageAgents: true, datasetOperator: false, enableSkill: true },+ true,+ true,+ ],+ [+ { agentEnabled: false, canManageAgents: true, datasetOperator: false, enableSkill: true },+ false,+ true,+ ],+ [+ { agentEnabled: true, canManageAgents: false, datasetOperator: true, enableSkill: true },+ false,+ false,+ ],+ [+ { agentEnabled: true, canManageAgents: true, datasetOperator: false, enableSkill: false },+ true,+ false,+ ],] as const)('matches scope visibility to workspace capabilities',(visibility, agents, skills) => {@@ -744,6 +771,24 @@ describe('GotoAnything', () => {)})+ it('does not query skills when the skill feature is disabled', async () => {+ const user = userEvent.setup()+ visibilityState.enableSkill = false++ renderGotoAnything(<GotoAnything />)+ triggerSearchShortcut()+ const input = await screen.findByRole('combobox', {+ name: 'app.gotoAnything.searchTitle',+ })++ await user.type(input, 'research')++ expect(enabledRemoteQueryKeys).toEqual(+ expect.arrayContaining(['app', 'knowledge', 'plugin', 'agent']),+ )+ expect(enabledRemoteQueryKeys).not.toContain('skill')+ })+it('trims trailing whitespace before an ordinary remote search', async () => {const user = userEvent.setup()renderGotoAnything(<GotoAnything />)diff --git a/web/app/components/goto-anything/index.tsx b/web/app/components/goto-anything/index.tsxindex 7c10b56cf2e..8296ec1e1f6 100644--- a/web/app/components/goto-anything/index.tsx+++ b/web/app/components/goto-anything/index.tsx@@ -40,6 +40,7 @@ import { useTranslation } from 'react-i18next'import { MAIN_NAV_ROUTES } from '@/app/components/main-nav/routes'import { selectWorkflowNode } from '@/app/components/workflow/utils/node-navigation'import { useGetLanguage } from '@/context/i18n'+import { useProviderContextSelector } from '@/context/provider-context'import { isCurrentWorkspaceDatasetOperatorAtom } from '@/context/workspace-state'import { isAgentV2Enabled } from '@/features/agent-v2/feature-flag'import { useCanManageAgents } from '@/features/agent-v2/permissions'@@ -232,8 +233,9 @@ function GotoAnythingDialog() {const defaultLocale = useGetLanguage()const canManageAgents = useCanManageAgents()const isCurrentWorkspaceDatasetOperator = useAtomValue(isCurrentWorkspaceDatasetOperatorAtom)+ const enableSkill = useProviderContextSelector((state) => state.enableSkill)const agentsAvailable = isAgentV2Enabled() && canManageAgents- const skillsAvailable = !isCurrentWorkspaceDatasetOperator+ const skillsAvailable = enableSkill && !isCurrentWorkspaceDatasetOperatorconst isWorkflowPage =appWorkflowPathPattern.test(pathname) || sharedWorkflowPathPattern.test(pathname)const isRagPipelinePage = ragPipelinePathPattern.test(pathname)