Migrate Custom Assistants to Agents#6163
Migrate Custom Assistants to Agents#6163HenryHengZJ wants to merge 43 commits intofeature/SmartAgentsfrom
Conversation
- Replace dual-table (assistant + chatflow) with single chatflow table for Agents. - Add /agents route as default landing page - Full configure page with dynamic field options from server node definitions - Dedicated agents RBAC permission group - Agent marketplace template type with view-only preview, type-validated export/import, and evaluation updates.
There was a problem hiding this comment.
Code Review
This pull request rebrands "Custom Assistants" to "Agents" across the application, introducing a new "Agent" chatflow type and updating the UI, server logic, and database migrations accordingly. Key changes include the addition of an AgentListMenu component, new routes for agents, and updated RBAC permissions. Feedback focuses on fixing incorrect prop usage in CustomAssistantLayout.jsx, adding error handling for marketplace JSON parsing, implementing rollback logic in database migrations, and ensuring consistent permission naming.
…ents permission additions - Wrap all marketplace template JSON parsing in try-catch to prevent a single malformed file from crashing the entire marketplace - Remove incompatible AgentListMenu from legacy CustomAssistantLayout
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request rebrands "Custom Assistant" to "Agent" across the application, involving updates to UI components, routes, and menu items. Server-side logic and database migrations have been implemented to support the new AGENT chatflow type while maintaining backward compatibility for legacy ASSISTANT records. Additionally, "Chatflow Latency" is renamed to "Flow Latency" in evaluators, and validation has been added for flow file imports. Feedback was provided to avoid hardcoded hex colors in the new Agents view, recommending the use of theme-based colors for better consistency across different display modes.
…/github.com/FlowiseAI/Flowise into feature/Migrate-Custom-Assistants-to-Agents
* add compact table transformer for NotionAPILoader . * fix: improve table transformation logic in NotionAPILoader * fix: improve table transformation logic in NotionAPILoader * fix: improve table transformation logic in NotionAPILoader
add groq sdk
include action metadata from API responses
silent fallback to vm2 for sandbox execution
* feat(components): add Baidu Qianfan embeddings node * fix(components): preserve explicit numeric values in Baidu embeddings * Improve Qianfan embedding defaults and guidance
…y state (#6210) - Implemented auto-add functionality for Start node in Agentflow when creating a new canvas. - Updated default values for number and options types to return empty strings instead of zero or first option name. - Adjusted MessagesInput and ArrayInput tests to reflect changes in default values.
release@3.1.2 Co-authored-by: yau-wd <yau.ong@workday.com>
* fix(server): clickjacking * fix(XSS.ts): handle CSV and null values in getAllowedIframeOrigins
…Edge, and duplicateNode actions (#6211) * fix(agentflow): add onFlowChange notifications for deleteNode, deleteEdge, and duplicateNode actions - Updated context state management to include viewport information during flow changes. - Improved test coverage for flow change notifications to ensure correct behavior on node and edge modifications. * address gemini comment
… node (#6212) - Enhanced Start node to include a client property for the form input option, allowing differentiation between 'agentflowv2' and 'agentflowsdk'. - Added tests to verify that the 'formInput' option is correctly filtered based on the client type.
* feat: turn chatflow into MCP server - Added '@modelcontextprotocol/sdk' version 1.12.0 - Added 'zod' version 3.25.32 - Added migrations for MCP server config - Added MCP endpoints (Streamable HTTP and SSE) - Added MCP server configuration tab - Added unit tests for MCP endpoints and services * feat: Implement MCP endpoint service with SSE support - Added a new MCP endpoint service to handle requests for chatflows, including support for SSE (Server-Sent Events) and stateless transport. - Introduced functions for handling MCP requests, SSE connections, and message routing. - Implemented error handling for service errors and session management for SSE. - Created unit tests for the MCP server service, covering configuration CRUD operations and token management. - Updated the MCP server configuration logic to ensure proper validation and error handling. - Refactored the UI component to utilize a new API hook for fetching MCP server configuration. * chore: handle error when get mcp server config * - Introduced a new chat type 'MCP' in the ChatType enum, including UI filters and backend processing. - Updated the zod dependency version specification to support both ^3.25.76 and ^4. - Fix setHasExistingConfig * fix: update chatflowCallback to enable chatflow building with active state for MCP * refactor: remove deprecated SSE transport endpoints and related logic - Removed handleGet and handleSseMessage methods from MCP endpoint controller. - Updated MCP endpoint routes to eliminate SSE-related routes. - Refactored service layer to remove SSE session management and related methods. - Updated tests to remove references to deprecated SSE functionality. - Adjusted UI component to remove SSE endpoint URL handling. * chore: update MCP endpoint routes and references to align with new API structure * chore: remove abortChatMessage when mcp request closed * optimize mcpserver dialog for dark mode * feat: implement form input schema generation for agentflow chatflows --------- Co-authored-by: Henry <hzj94@hotmail.com>
…xt to validate (#6224) * feat(agentflow): optional cavasActions to allow additional buttons next to validate - Updated Agentflow component to support canvasActions prop for rendering additional action buttons in the canvas overlay. - Enhanced type definitions to include canvasActions in AgentflowProps. - Added tests to verify the rendering of canvasActions in the Agentflow component. - Added a new example demonstrating custom FABs alongside the validation button. * update jsdoc to match actual implementation
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* enhance ChatflowConfigurationDialog with new configuration sections and improved UI * fix: remove background color override for MuiSvgIcon in dark mode
# Conflicts: # packages/server/src/database/migrations/mariadb/index.ts # packages/server/src/database/migrations/mysql/index.ts # packages/server/src/database/migrations/postgres/index.ts # packages/server/src/database/migrations/sqlite/index.ts
#6226) - Updated Agent node to include 'client' property for 'agentKnowledgeDocumentStores' and 'agentKnowledgeVSEmbeddings', allowing differentiation between 'agentflowv2' and 'agentflowsdk'. - Added tests to ensure correct filtering of knowledge fields based on client type.
* To highlight input fiels in dark mode * Fix background color of edit node dialog * Fix background color for input messages field * Fix Message container * Fix border container color * Make token be referenced by name * Revert changes to server file * Fix gemini comments
* Bring canvas buttons to same z-index level * gemini suggested Fixes * missing space
* Fix z-index for validation * Reverting changes to ValidationFeedback.tsx * Use tokens for z index
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
… generation (#6233) * Reject malformed MCP form option metadata before schema generation crashes Chatflow-as-MCP-server assumes addOptions is always an array for form fields of type 'options'. Imported or malformed configs can carry '', null, or undefined instead, which throws during schema generation. This change fails fast with a controlled validation path and adds coverage for those cases. Constraint: Fix should stay inside the server-side MCP endpoint path Rejected: Normalize all malformed values silently | hides bad config state and weakens feedback Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep MCP schema generation defensive around imported flow JSON shapes Tested: Added unit coverage for string, undefined, and null addOptions cases; local runtime repro confirms prior crash modes Not-tested: Full end-to-end MCP initialize/tools-list call against a running server * Keep malformed MCP option metadata from taking down form tool schemas The maintainer follow-up on the MCP schema fix asked for malformed or empty options metadata to be ignored rather than treated as a fatal configuration error. This updates the schema builder to skip unusable enum fields, adds test coverage for those cases, and narrows the start-node shape locally so the server-side test can compile against the current interface types. Constraint: Maintainer requested skip semantics for invalid/empty addOptions instead of hard failure Rejected: Preserve throw-on-invalid behavior | conflicts with upstream maintainer direction Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep malformed or empty options metadata non-fatal; omit that field rather than breaking the whole MCP tool schema Tested: pnpm --dir packages/components build; pnpm --dir packages/server test -- src/services/mcp-endpoint/index.test.ts --runInBand Not-tested: End-to-end MCP initialize/tools/list flow against a live server * add schema checks for input.addOptions --------- Co-authored-by: Henry Heng <henryheng@flowiseai.com>
* fix: replace full message load in stats endpoint with SQL COUNT queries * fix: replace full message load in stats endpoint with SQL COUNT queries Loading all messages into memory to compute stats caused OOM crashes with large chat volumes. Replaced with parallel SQL COUNT queries that never load message rows. The feedbackTypes filter now uses a correlated subquery to avoid hitting PostgreSQL's parameter limit at high feedback volumes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feedback filters were incorrectly filtering messages with feedback of the WHOLE session, instead of just the feedback + previous message. Added code to count preceding messages as count to mimic previous functionality * fix: consolidate stats queries from 4 round-trips into 1 combined query Replace 4 separate COUNT QueryBuilders (totalMessages, totalSessions, totalFeedback, positiveFeedback) with a single query using addSelect and CASE WHEN for the positive feedback breakdown. When a feedbackTypes filter is active, reduce from 5 round-trips down to 2 (combined + preceding). Update tests to match the new single getRawOne call and aliased column names. --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
- smartagents
* - pass langchain message instance as a whole to avoid missing reasoning item - add `normalizeMessagesForStorage` function to convert LangChain message instances into plain JSON objects, improving database storage efficiency and UI readability * - Fix ChatflowConfigurationDialog for inconsistent behaviour - Added a button in NodeExecutionDetails to toggle visibility of all available tools, improving user experience. * display input data for tool node in execution
* feat(components): add support for Claude Opus 4.7 model and logic * fix(components): update thinkingEffort description to include newer Opus models * Update models.json for opus 4-7 --------- Co-authored-by: Henry Heng <henryheng@flowiseai.com>
…esponsive grid layout adjustments. Added a ToggleButtonGroup for selecting agentflow versions and updated grid templates for better responsiveness during loading states.
… example (#6245) * fix(agentflow): fix variable resolution, credential sync, and add E2E example - Fix variable picker emitting {{nodeId.data.instance}} instead of {{nodeId}} - Fix customMention serializer using display label instead of node ID - Fix Start node missing outputData.content for chatInput type - Sync credential selection to nodeData.credential for server-side execution - Add E2E example with save/delete/test-run FABs via canvasActions - Simplify BasicExample to minimal canvas-only usage - Fix act() warnings in TooltipWithParser and useAsyncOptions tests Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(agentflow): add user-facing error feedback for save failures in E2E example Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(agentflow): fix variable chip display and revert Start node content field - VariableInput: show {{nodeId}} in mention chip instead of display label, consistent with the value serialized to flow data - useAvailableVariables: exclude startAgentflow from upstream node outputs; users reference the question via {{question}} (global variable), matching agentflow v2 behavior — no Start node change or server change needed - Start.ts: revert outputData.content = input; Start node is no longer exposed as a node output variable in the picker Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* Preserve explicit iframe allowlists when hardening frame headers The clickjacking fix correctly added frame-ancestors controls, but custom allowlists still emitted X-Frame-Options: DENY. This keeps SAMEORIGIN for 'self' and DENY for 'none', while letting explicit allowlists rely on CSP alone so supported embeds continue to work. Constraint: Legacy X-Frame-Options cannot express arbitrary allowlists Rejected: Keep DENY for all non-self values | breaks documented IFRAME_ORIGINS allowlists Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep CSP as the source of truth for custom iframe allowlists; do not reintroduce contradictory XFO headers Tested: Added unit coverage for wildcard, self, none, and custom allowlists; local header reproduction for custom origin Not-tested: Full browser iframe E2E across legacy browsers * Avoid malformed iframe CSP values while removing per-request header recomputation Gemini's review pointed out two low-risk improvements that strengthen the existing iframe allowlist fix without changing its intent: normalize away empty CSV tokens before building frame-ancestors, and compute the static header set once during app startup instead of rebuilding it on every request. Constraint: IFRAME_ORIGINS is startup configuration, not a dynamic per-request input Rejected: Larger header-construction refactor | not necessary to address the concrete review feedback Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep CSP token normalization aligned with explicit allowlists so empty CSV segments never leak into frame-ancestors Tested: pnpm --dir packages/server test -- src/utils/XSS.test.ts --runInBand Not-tested: Full browser iframe embed verification against a running server --------- Co-authored-by: yau-wd <yau.ong@workday.com>
* fix(mcp): preserve tool input schema types and required fields * Update OpenAIAssistant.ts * replace zod-to-json-schema with toolSchemaToJsonSchema for schema normalization * enhance isZodSchema validation and handle null schemas in toolSchemaToJsonSchema
# Conflicts: # packages/components/nodes/agentflow/utils.ts
…ta extraction and UI elements. Updated agentflow version condition in agentflows view and removed unnecessary loading state in dataset views. Improved rendering of agent information in marketplaces, including system message and model details.
FLOWISE-457
Summary
/agentsroute as the default landing pagetype='AGENT'agentsRBAC permission group with DB migration via SQL REPLACE for production scalesmartagent.mp4
Key Changes
Architecture Simplification
getAllChatflows('AGENT')returns both legacy ASSISTANT and new AGENT type recordsUI — Agent Configure Page
Permissions
agentspermission group (view, create, update, duplicate, delete, export, import, config, domains)assistants:*→agents:*using SQL REPLACE (O(1) bulk, scales to millions)agents:*permission checksMarketplace
Agenttemplate type with dedicated filter chip/marketplace/agents/:id/agents/newwith fields populatedmarketplaces/agents/)Evaluations
Export/Import
typefield (CHATFLOW, AGENTFLOW, AGENT, MULTIAGENT)credentialandFLOWISE_CREDENTIAL_IDkeys)Execution Details
/agents/:idinstead of/v2/agentcanvas/:idTest plan
/agents/new→ configure → save → verify chatflow created with type AGENT"type": "AGENT"and no credentials/agents/newagentsgroup first, existing roles haveagents:*after migrationFollow up
zIndexissue on the chatembed side with the titlebar and modal pop up