From b85564cae573011fb815fdc39c23f905dd009ab8 Mon Sep 17 00:00:00 2001 From: Wu Tianwei <30284043+WTW0313@users.noreply.github.com> Date: Sun, 28 Dec 2025 02:00:30 +0800 Subject: [PATCH 01/20] fix: remove unused CSS styles and fix HitTestingPage layout (#30235) --- .../components/datasets/hit-testing/index.tsx | 7 ++- .../datasets/hit-testing/style.module.css | 43 ------------------- 2 files changed, 3 insertions(+), 47 deletions(-) delete mode 100644 web/app/components/datasets/hit-testing/style.module.css diff --git a/web/app/components/datasets/hit-testing/index.tsx b/web/app/components/datasets/hit-testing/index.tsx index e75ef48abf..d810442704 100644 --- a/web/app/components/datasets/hit-testing/index.tsx +++ b/web/app/components/datasets/hit-testing/index.tsx @@ -34,7 +34,6 @@ import Records from './components/records' import ResultItem from './components/result-item' import ResultItemExternal from './components/result-item-external' import ModifyRetrievalModal from './modify-retrieval-modal' -import s from './style.module.css' const limit = 10 @@ -115,8 +114,8 @@ const HitTestingPage: FC = ({ datasetId }: Props) => { }, [isMobile, setShowRightPanel]) return ( -
-
+
+

{t('datasetHitTesting.title')}

{t('datasetHitTesting.desc')}

@@ -161,7 +160,7 @@ const HitTestingPage: FC = ({ datasetId }: Props) => { onClose={hideRightPanel} footer={null} > -
+
{isRetrievalLoading ? (
diff --git a/web/app/components/datasets/hit-testing/style.module.css b/web/app/components/datasets/hit-testing/style.module.css deleted file mode 100644 index a421962f48..0000000000 --- a/web/app/components/datasets/hit-testing/style.module.css +++ /dev/null @@ -1,43 +0,0 @@ -.container { - @apply flex h-full w-full relative overflow-y-auto; -} - -.container>div { - @apply flex-1 h-full; -} - -.commonIcon { - @apply w-3.5 h-3.5 inline-block align-middle; - background-repeat: no-repeat; - background-position: center center; - background-size: contain; -} - -.app_icon { - background-image: url(./assets/grid.svg); -} - -.hit_testing_icon { - background-image: url(../documents/assets/target.svg); -} - -.plugin_icon { - background-image: url(./assets/plugin.svg); -} - -.cardWrapper { - display: grid; - grid-template-columns: repeat(auto-fill, minmax(284px, auto)); - grid-gap: 16px; - grid-auto-rows: 216px; -} - -.clockWrapper { - border: 0.5px solid #eaecf5; - @apply rounded-lg w-11 h-11 flex justify-center items-center; -} - -.clockIcon { - mask-image: url(./assets/clock.svg); - @apply bg-gray-500; -} From b067ad2f0a4f1aa8e5bedc1fbf12b2b7f1e5af4d Mon Sep 17 00:00:00 2001 From: Sara Rasool <83841462+sarxxt@users.noreply.github.com> Date: Sat, 27 Dec 2025 10:01:57 -0800 Subject: [PATCH 02/20] chore(web): remove unused dev-preview page (#30226) Co-authored-by: Dev --- web/app/dev-preview/page.tsx | 68 ------------------------------------ 1 file changed, 68 deletions(-) delete mode 100644 web/app/dev-preview/page.tsx diff --git a/web/app/dev-preview/page.tsx b/web/app/dev-preview/page.tsx deleted file mode 100644 index 90090acdd0..0000000000 --- a/web/app/dev-preview/page.tsx +++ /dev/null @@ -1,68 +0,0 @@ -'use client' -import BaseForm from '../components/base/form/form-scenarios/base' -import { BaseFieldType } from '../components/base/form/form-scenarios/base/types' - -export default function Page() { - return ( -
-
- { - console.log('onSubmit', value) - }} - /> -
-
- ) -} From d8010a7fbce0e627685c985bd24d1220a9b560a1 Mon Sep 17 00:00:00 2001 From: Novice Date: Sun, 28 Dec 2025 02:02:46 +0800 Subject: [PATCH 03/20] fix: Add JSON RPC request type guard (#30216) --- api/core/mcp/client/streamable_client.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/api/core/mcp/client/streamable_client.py b/api/core/mcp/client/streamable_client.py index f81e7cead8..5c3cd0d8f8 100644 --- a/api/core/mcp/client/streamable_client.py +++ b/api/core/mcp/client/streamable_client.py @@ -313,17 +313,20 @@ class StreamableHTTPTransport: if is_initialization: self._maybe_extract_session_id_from_response(response) - content_type = cast(str, response.headers.get(CONTENT_TYPE, "").lower()) + # Per https://modelcontextprotocol.io/specification/2025-06-18/basic#notifications: + # The server MUST NOT send a response to notifications. + if isinstance(message.root, JSONRPCRequest): + content_type = cast(str, response.headers.get(CONTENT_TYPE, "").lower()) - if content_type.startswith(JSON): - self._handle_json_response(response, ctx.server_to_client_queue) - elif content_type.startswith(SSE): - self._handle_sse_response(response, ctx) - else: - self._handle_unexpected_content_type( - content_type, - ctx.server_to_client_queue, - ) + if content_type.startswith(JSON): + self._handle_json_response(response, ctx.server_to_client_queue) + elif content_type.startswith(SSE): + self._handle_sse_response(response, ctx) + else: + self._handle_unexpected_content_type( + content_type, + ctx.server_to_client_queue, + ) def _handle_json_response( self, From 2b01f85d61fe9966e176ab2ec0fa22a54dc3c044 Mon Sep 17 00:00:00 2001 From: Maries Date: Sun, 28 Dec 2025 02:03:42 +0800 Subject: [PATCH 04/20] fix: consolidate duplicate InvokeRateLimitError definitions (#30229) Co-authored-by: Claude Opus 4.5 --- api/services/app_generate_service.py | 3 ++- api/services/async_workflow_service.py | 4 ++-- api/services/errors/app.py | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/api/services/app_generate_service.py b/api/services/app_generate_service.py index 4514c86f7c..cc58899dc4 100644 --- a/api/services/app_generate_service.py +++ b/api/services/app_generate_service.py @@ -14,7 +14,8 @@ from enums.quota_type import QuotaType, unlimited from extensions.otel import AppGenerateHandler, trace_span from models.model import Account, App, AppMode, EndUser from models.workflow import Workflow -from services.errors.app import InvokeRateLimitError, QuotaExceededError, WorkflowIdFormatError, WorkflowNotFoundError +from services.errors.app import QuotaExceededError, WorkflowIdFormatError, WorkflowNotFoundError +from services.errors.llm import InvokeRateLimitError from services.workflow_service import WorkflowService diff --git a/api/services/async_workflow_service.py b/api/services/async_workflow_service.py index e100582511..bc73b7c8c2 100644 --- a/api/services/async_workflow_service.py +++ b/api/services/async_workflow_service.py @@ -21,7 +21,7 @@ from models.model import App, EndUser from models.trigger import WorkflowTriggerLog from models.workflow import Workflow from repositories.sqlalchemy_workflow_trigger_log_repository import SQLAlchemyWorkflowTriggerLogRepository -from services.errors.app import InvokeRateLimitError, QuotaExceededError, WorkflowNotFoundError +from services.errors.app import QuotaExceededError, WorkflowNotFoundError, WorkflowQuotaLimitError from services.workflow.entities import AsyncTriggerResponse, TriggerData, WorkflowTaskData from services.workflow.queue_dispatcher import QueueDispatcherManager, QueuePriority from services.workflow_service import WorkflowService @@ -141,7 +141,7 @@ class AsyncWorkflowService: trigger_log_repo.update(trigger_log) session.commit() - raise InvokeRateLimitError( + raise WorkflowQuotaLimitError( f"Workflow execution quota limit reached for tenant {trigger_data.tenant_id}" ) from e diff --git a/api/services/errors/app.py b/api/services/errors/app.py index 24e4760acc..60e59e97dc 100644 --- a/api/services/errors/app.py +++ b/api/services/errors/app.py @@ -18,8 +18,8 @@ class WorkflowIdFormatError(Exception): pass -class InvokeRateLimitError(Exception): - """Raised when rate limit is exceeded for workflow invocations.""" +class WorkflowQuotaLimitError(Exception): + """Raised when workflow execution quota is exceeded (for async/background workflows).""" pass From 1f2c85c916a8cfaf4c0bbb4192e0fe71fafe557a Mon Sep 17 00:00:00 2001 From: NeatGuyCoding <15627489+NeatGuyCoding@users.noreply.github.com> Date: Sun, 28 Dec 2025 13:47:54 +0800 Subject: [PATCH 05/20] fix: wrong usage of redis lock (#28177) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: NeatGuyCoding <15627489+NeatGuyCoding@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Maries Co-authored-by: 非法操作 --- api/services/trigger/webhook_service.py | 31 ++++++++++++++++++------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/api/services/trigger/webhook_service.py b/api/services/trigger/webhook_service.py index 5c4607d400..4159f5f8f4 100644 --- a/api/services/trigger/webhook_service.py +++ b/api/services/trigger/webhook_service.py @@ -863,10 +863,18 @@ class WebhookService: not_found_in_cache.append(node_id) continue - with Session(db.engine) as session: - try: - # lock the concurrent webhook trigger creation - redis_client.lock(f"{cls.__WEBHOOK_NODE_CACHE_KEY__}:apps:{app.id}:lock", timeout=10) + lock_key = f"{cls.__WEBHOOK_NODE_CACHE_KEY__}:apps:{app.id}:lock" + lock = redis_client.lock(lock_key, timeout=10) + lock_acquired = False + + try: + # acquire the lock with blocking and timeout + lock_acquired = lock.acquire(blocking=True, blocking_timeout=10) + if not lock_acquired: + logger.warning("Failed to acquire lock for webhook sync, app %s", app.id) + raise RuntimeError("Failed to acquire lock for webhook trigger synchronization") + + with Session(db.engine) as session: # fetch the non-cached nodes from DB all_records = session.scalars( select(WorkflowWebhookTrigger).where( @@ -903,11 +911,16 @@ class WebhookService: session.delete(nodes_id_in_db[node_id]) redis_client.delete(f"{cls.__WEBHOOK_NODE_CACHE_KEY__}:{app.id}:{node_id}") session.commit() - except Exception: - logger.exception("Failed to sync webhook relationships for app %s", app.id) - raise - finally: - redis_client.delete(f"{cls.__WEBHOOK_NODE_CACHE_KEY__}:apps:{app.id}:lock") + except Exception: + logger.exception("Failed to sync webhook relationships for app %s", app.id) + raise + finally: + # release the lock only if it was acquired + if lock_acquired: + try: + lock.release() + except Exception: + logger.exception("Failed to release lock for webhook sync, app %s", app.id) @classmethod def generate_webhook_id(cls) -> str: From 543ce38a6c5d6223f29956c3bfefe4565157965e Mon Sep 17 00:00:00 2001 From: yyh <92089059+lyzno1@users.noreply.github.com> Date: Sun, 28 Dec 2025 17:48:55 +0800 Subject: [PATCH 06/20] chore(claude-code): migrate from legacy MCP configuration to official plugin system (#30265) --- .claude/settings.json | 8 ++++++++ .claude/settings.json.example | 19 ------------------- .mcp.json | 34 ---------------------------------- 3 files changed, 8 insertions(+), 53 deletions(-) create mode 100644 .claude/settings.json delete mode 100644 .claude/settings.json.example delete mode 100644 .mcp.json diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 0000000000..7d42234cae --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,8 @@ +{ + "enabledPlugins": { + "feature-dev@claude-plugins-official": true, + "context7@claude-plugins-official": true, + "typescript-lsp@claude-plugins-official": true, + "pyright-lsp@claude-plugins-official": true + } +} diff --git a/.claude/settings.json.example b/.claude/settings.json.example deleted file mode 100644 index 1149895340..0000000000 --- a/.claude/settings.json.example +++ /dev/null @@ -1,19 +0,0 @@ -{ - "permissions": { - "allow": [], - "deny": [] - }, - "env": { - "__comment": "Environment variables for MCP servers. Override in .claude/settings.local.json with actual values.", - "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - }, - "enabledMcpjsonServers": [ - "context7", - "sequential-thinking", - "github", - "fetch", - "playwright", - "ide" - ], - "enableAllProjectMcpServers": true - } \ No newline at end of file diff --git a/.mcp.json b/.mcp.json deleted file mode 100644 index 8eceaf9ead..0000000000 --- a/.mcp.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "mcpServers": { - "context7": { - "type": "http", - "url": "https://mcp.context7.com/mcp" - }, - "sequential-thinking": { - "type": "stdio", - "command": "npx", - "args": ["-y", "@modelcontextprotocol/server-sequential-thinking"], - "env": {} - }, - "github": { - "type": "stdio", - "command": "npx", - "args": ["-y", "@modelcontextprotocol/server-github"], - "env": { - "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_PERSONAL_ACCESS_TOKEN}" - } - }, - "fetch": { - "type": "stdio", - "command": "uvx", - "args": ["mcp-server-fetch"], - "env": {} - }, - "playwright": { - "type": "stdio", - "command": "npx", - "args": ["-y", "@playwright/mcp@latest"], - "env": {} - } - } - } \ No newline at end of file From bf56c2e9dbdff0426cdfd6c1574ecdc2aef307b6 Mon Sep 17 00:00:00 2001 From: wangxiaolei Date: Sun, 28 Dec 2025 17:50:30 +0800 Subject: [PATCH 07/20] fix: fix custom tool content is not update (#30250) --- .../edit-custom-collection-modal/index.tsx | 11 ++++++- web/app/components/tools/provider/detail.tsx | 33 +++++++++++-------- .../header/version-history-button.tsx | 2 +- 3 files changed, 30 insertions(+), 16 deletions(-) diff --git a/web/app/components/tools/edit-custom-collection-modal/index.tsx b/web/app/components/tools/edit-custom-collection-modal/index.tsx index 474c262010..a468af7257 100644 --- a/web/app/components/tools/edit-custom-collection-modal/index.tsx +++ b/web/app/components/tools/edit-custom-collection-modal/index.tsx @@ -48,6 +48,7 @@ const EditCustomCollectionModal: FC = ({ const [editFirst, setEditFirst] = useState(!isAdd) const [paramsSchemas, setParamsSchemas] = useState(payload?.tools || []) + const [labels, setLabels] = useState(payload?.labels || []) const [customCollection, setCustomCollection, getCustomCollection] = useGetState(isAdd ? { provider: '', @@ -67,6 +68,15 @@ const EditCustomCollectionModal: FC = ({ const originalProvider = isEdit ? payload.provider : '' + // Sync customCollection state when payload changes + useEffect(() => { + if (isEdit) { + setCustomCollection(payload) + setParamsSchemas(payload.tools || []) + setLabels(payload.labels || []) + } + }, [isEdit, payload]) + const [showEmojiPicker, setShowEmojiPicker] = useState(false) const emoji = customCollection.icon const setEmoji = (emoji: Emoji) => { @@ -124,7 +134,6 @@ const EditCustomCollectionModal: FC = ({ const [currTool, setCurrTool] = useState(null) const [isShowTestApi, setIsShowTestApi] = useState(false) - const [labels, setLabels] = useState(payload?.labels || []) const handleLabelSelect = (value: string[]) => { setLabels(value) } diff --git a/web/app/components/tools/provider/detail.tsx b/web/app/components/tools/provider/detail.tsx index c4b65f353d..e0a2281696 100644 --- a/web/app/components/tools/provider/detail.tsx +++ b/web/app/components/tools/provider/detail.tsx @@ -100,9 +100,28 @@ const ProviderDetail = ({ const [isShowEditCollectionToolModal, setIsShowEditCustomCollectionModal] = useState(false) const [showConfirmDelete, setShowConfirmDelete] = useState(false) const [deleteAction, setDeleteAction] = useState('') + + const getCustomProvider = useCallback(async () => { + setIsDetailLoading(true) + const res = await fetchCustomCollection(collection.name) + if (res.credentials.auth_type === AuthType.apiKey && !res.credentials.api_key_header_prefix) { + if (res.credentials.api_key_value) + res.credentials.api_key_header_prefix = AuthHeaderPrefix.custom + } + setCustomCollection({ + ...res, + labels: collection.labels, + provider: collection.name, + }) + setIsDetailLoading(false) + }, [collection.labels, collection.name]) + const doUpdateCustomToolCollection = async (data: CustomCollectionBackend) => { await updateCustomCollection(data) onRefreshData() + await getCustomProvider() + // Use fresh data from form submission to avoid race condition with collection.labels + setCustomCollection(prev => prev ? { ...prev, labels: data.labels } : null) Toast.notify({ type: 'success', message: t('common.api.actionSuccess'), @@ -118,20 +137,6 @@ const ProviderDetail = ({ }) setIsShowEditCustomCollectionModal(false) } - const getCustomProvider = useCallback(async () => { - setIsDetailLoading(true) - const res = await fetchCustomCollection(collection.name) - if (res.credentials.auth_type === AuthType.apiKey && !res.credentials.api_key_header_prefix) { - if (res.credentials.api_key_value) - res.credentials.api_key_header_prefix = AuthHeaderPrefix.custom - } - setCustomCollection({ - ...res, - labels: collection.labels, - provider: collection.name, - }) - setIsDetailLoading(false) - }, [collection.labels, collection.name]) // workflow provider const [isShowEditWorkflowToolModal, setIsShowEditWorkflowToolModal] = useState(false) const getWorkflowToolProvider = useCallback(async () => { diff --git a/web/app/components/workflow/header/version-history-button.tsx b/web/app/components/workflow/header/version-history-button.tsx index ae3bd68b48..9ec9e6934e 100644 --- a/web/app/components/workflow/header/version-history-button.tsx +++ b/web/app/components/workflow/header/version-history-button.tsx @@ -61,7 +61,7 @@ const VersionHistoryButton: FC = ({ > )} + {onBatchReIndex && ( + + )}