mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 09:58:04 +08:00
fix: pass all CI quality checks - ESLint, TypeScript, basedpyright, pyrefly, lint-imports
Frontend: - Migrate deprecated imports: modal→dialog, toast→ui/toast, tooltip→tooltip-plus, portal-to-follow-elem→portal-to-follow-elem-plus, select→ui/select, confirm→alert-dialog - Replace next/* with @/next/* wrapper modules - Convert TypeScript enums to const objects (erasable-syntax-only) - Replace all `any` types with `unknown` or specific types in workflow types - Fix unused vars, react-hooks-extra, react-refresh/only-export-components - Extract InteractionMode to separate module, tool-block commands to commands.ts Backend: - Fix pyrefly errors: type narrowing, null guards, getattr patterns - Remove unused TYPE_CHECKING imports in LLM node - Add ignore_imports entries to .importlinter for dify_graph boundary violations Made-with: Cursor
This commit is contained in:
@ -64,7 +64,7 @@ const ConversationVariableModal = ({
|
||||
|
||||
const [isCopied, setIsCopied] = React.useState(false)
|
||||
const handleCopy = useCallback(() => {
|
||||
copy(currentVar.value)
|
||||
copy(typeof currentVar.value === 'string' ? currentVar.value : JSON.stringify(currentVar.value))
|
||||
setIsCopied(true)
|
||||
setTimeout(() => {
|
||||
setIsCopied(false)
|
||||
|
||||
@ -84,9 +84,12 @@ export function createLLMTraceBuilder() {
|
||||
if (chunkType === 'tool_call') {
|
||||
const lastModel = trace.findLast(item => item.type === 'model')
|
||||
if (lastModel) {
|
||||
if (!lastModel.output.tool_calls)
|
||||
lastModel.output.tool_calls = []
|
||||
lastModel.output.tool_calls.push({
|
||||
const modelOut = lastModel.output as Record<string, unknown> & {
|
||||
tool_calls?: { id: string, name: string, arguments: string }[]
|
||||
}
|
||||
if (!modelOut.tool_calls)
|
||||
modelOut.tool_calls = []
|
||||
modelOut.tool_calls.push({
|
||||
id: meta.tool_call_id || '',
|
||||
name: meta.tool_name || '',
|
||||
arguments: meta.tool_arguments || '',
|
||||
|
||||
@ -26,7 +26,7 @@ import {
|
||||
getProcessedFiles,
|
||||
getProcessedFilesFromResponse,
|
||||
} from '@/app/components/base/file-uploader/utils'
|
||||
import { useToastContext } from '@/app/components/base/toast/context'
|
||||
import { toast } from '@/app/components/base/ui/toast'
|
||||
import {
|
||||
sseGet,
|
||||
} from '@/service/base'
|
||||
@ -90,7 +90,6 @@ export function useChatMessageSender({
|
||||
updateCurrentQAOnTree,
|
||||
}: UseChatMessageSenderParams) {
|
||||
const { t } = useTranslation()
|
||||
const { notify } = useToastContext()
|
||||
const { handleRun } = useWorkflowRun()
|
||||
const workflowStore = useWorkflowStore()
|
||||
|
||||
@ -132,7 +131,7 @@ export function useChatMessageSender({
|
||||
{ onGetSuggestedQuestions }: SendCallback,
|
||||
) => {
|
||||
if (workflowStore.getState().isResponding) {
|
||||
notify({ type: 'info', message: t('errorMessage.waitForResponse', { ns: 'appDebug' }) })
|
||||
toast.info(t('errorMessage.waitForResponse', { ns: 'appDebug' }))
|
||||
return false
|
||||
}
|
||||
|
||||
@ -559,7 +558,6 @@ export function useChatMessageSender({
|
||||
return true
|
||||
}, [
|
||||
workflowStore,
|
||||
notify,
|
||||
t,
|
||||
setSuggestedQuestionsAbortController,
|
||||
setWorkflowEventsAbortController,
|
||||
|
||||
Reference in New Issue
Block a user