Commit Graph

250 Commits

Author SHA1 Message Date
zhsama
d876fddab0 Revert "feat(workflow): refine variable validation and scoping for workflow nodes, remove redundant End block checks"
This reverts commit 32fcbcdc62.
2026-02-10 20:00:11 +08:00
zhsama
32fcbcdc62 feat(workflow): refine variable validation and scoping for workflow nodes, remove redundant End block checks 2026-02-10 16:39:04 +08:00
zhsama
41b218f427 feat: LLM node to only show generation output var when computer use is
enabled, matching the actual output structure.
2026-02-09 23:40:42 +08:00
yyh
ca243d7efc chore(web): pre-align HITL frontend from build/feat/hitl 2026-02-09 15:34:15 +08:00
yyh
2b848d7e93 fix(workflow): prevent redundant sandbox download refetch after reset
Problem:\n- In variable inspect artifacts view, clicking Reset All invalidates sandbox download query keys.\n- If a previously selected file has been removed, the download-url query may still refetch with stale path and return 400.\n- Default query retry amplifies this into repeated failed requests in this scenario.\n\nSolution:\n- Extend sandbox file invalidation with an option to skip download query refetch.\n- Use that option in Reset All flow so download-url queries are marked stale without immediate refetch.\n- Derive selected file path from latest sandbox flat data and disable download-url query when file no longer exists.\n- Disable retry only for artifacts-tab download-url query to avoid repeated 400 retries in this path.\n- Align tree selectedPath with derived selectedFilePath and add hook tests for invalidation behavior.\n\nValidation:\n- pnpm vitest --run service/use-sandbox-file.spec.tsx
2026-02-07 22:43:13 +08:00
hjlarry
e10996c368 chore: log 20 recent crdt import changes 2026-02-07 10:12:47 +08:00
zhsama
8235ad9e62 fix: Fix variable availability resolution for child nodes in workflow 2026-02-05 16:57:19 +08:00
yyh
aad15a0777 fix: return invalidate promises and parallelize invalidations 2026-02-05 11:42:59 +08:00
yyh
740fafc926 feat: show Reset All button on both variable inspect tabs
- Change Reset All button visibility from Variables-tab-only to both tabs,
  displaying when either variables or artifacts have data
- Invalidate sandbox files cache in deleteAllInspectorVars alongside
  existing conversation/system var invalidations
2026-02-05 11:30:53 +08:00
hjlarry
70c887ed5c fix undo/redo 2026-02-03 18:00:06 +08:00
yyh
e2913d9ee1 Revert "refactor!: replace Zustand global store with TanStack Query for systemFeatures"
This reverts commit 806ece9a67.
2026-02-01 19:06:45 +08:00
yyh
806ece9a67 refactor!: replace Zustand global store with TanStack Query for systemFeatures
Follow-up to SSR prefetch migration (2833965). Eliminates the Zustand
middleman that was syncing TanStack Query data into a separate store.

- Remove useGlobalPublicStore Zustand store entirely
- Create hooks/use-global-public.ts with useSystemFeatures,
  useSystemFeaturesQuery, useIsSystemFeaturesPending, useSetupStatusQuery
- Migrate all 93 consumers to import from @/hooks/use-global-public
- Simplify global-public-context.tsx to a thin provider component
- Update 18 test files to mock the new hook interface
- Fix SetupStatusResponse.setup_at type from Date to string (JSON)
- Fix setup-status.spec.ts mock target to match consoleClient

BREAKING CHANGE: useGlobalPublicStore is removed. Use useSystemFeatures()
from @/hooks/use-global-public instead.
2026-02-01 19:06:08 +08:00
zhsama
bc1d3bdf57 refactor: Extract nested node ID parsing into shared utility 2026-01-30 22:24:30 +08:00
yyh
ff478b6fef perf(workflow): optimize plugin installation hooks to reduce unnecessary queries and memo invalidations
Only enable the tool query matching the node's provider_type instead of
all four, and use primitive useMemo dependencies instead of the whole
data object to avoid redundant recomputations on every render.
2026-01-30 01:56:07 +08:00
zhsama
e9c9f0d7cc perf(workflow): optimize nested-node cascade deletion 2026-01-30 01:53:19 +08:00
yyh
c8a0a2c00d perf(workflow): skip unnecessary query subscriptions for non-plugin nodes
Add `enabled` parameter to tool query hooks so non-plugin nodes
(LLM, Code, IfElse, etc.) avoid registering React Query observers.
Extract shared matching functions into plugin-install-check utils to
eliminate duplicate logic between the hook and the checklist.
2026-01-30 01:46:50 +08:00
zhsama
5d8ba8f8cc feat: Recursively delete nested children (sub-graph) when removing nodes 2026-01-30 01:40:57 +08:00
yyh
03f1197d77 fix(workflow): memoize useCollaborativeWorkflow return value
Wrap the returned object in useMemo to maintain referential stability
and prevent unnecessary re-renders in consumers.
2026-01-30 01:31:25 +08:00
yyh
464b92da32 fix(workflow): eliminate infinite loop in plugin install state management
Replace useEffect-based state sync (_pluginInstallLocked/_dimmed) with
render-time derived computation in BaseNode, breaking the cycle of
effect → node data update → re-render → effect. Extract plugin missing
check into a pure utility function for checklist reuse.
2026-01-30 01:30:57 +08:00
zhsama
9b62be2eb1 Refetch suggested questions after reset in context generate modal 2026-01-29 19:17:44 +08:00
hjlarry
26dd6c128c feat: mouse right click can add new comment 2026-01-29 09:13:12 +08:00
yyh
f16516549e feat(workflow): add clear button to workflow test run panel
Features:
- Add refresh button to clear test run history (data, inputs, node highlights)
- Persist workflowRunningData when closing panel (from previous commit)

Code quality improvements:
- Refactor to declarative pattern: effectiveTab derived from state, not set in effects
- Replace && with ternary operators for conditional rendering (Vercel best practices)
- Fix created_by type: change from string to object to match backend API
- Remove `as any` type assertion, use proper type-safe access
- Title now declaratively shows status based on workflowRunningData presence

Files changed:
- use-workflow-interactions.ts: add handleClearWorkflowRunHistory hook
- workflow-preview.tsx: declarative tab state, clear button, type-safe props
- types.ts: fix created_by type definition
- test files: update mock data to match corrected types
2026-01-28 22:48:27 +08:00
yyh
3dad0b38df refactor(workflow)!: persist workflowRunningData when closing debug panel
Keep test run results (RESULT/DETAIL/TRACING tabs) available after
closing and reopening the debug panel, or switching between Graph
and Skill views.
2026-01-28 21:15:45 +08:00
zxhlyh
3af927556e fix: workflow result generation render 2026-01-28 21:01:47 +08:00
zhsama
636156f5da fix: Fix workflow inspect vars to include parent nodes in subgraph mode 2026-01-28 18:24:04 +08:00
zhsama
7408405c91 feat: Add subgraph output validation for single-run debugging 2026-01-28 18:24:04 +08:00
zhsama
54fce5e903 feat: Add @agent icon and implement agent alias variables in workflow
inspector
2026-01-27 02:42:37 +08:00
yyh
772dbe620d fix(workflow): disable view switch during preview run instead of mounted guard
Simpler approach: disable the view picker toggle when preview is running,
preventing users from switching views during active runs.

This replaces the previous mounted ref guard approach (commits a0188bd9b5,
b7f1eb9b7b, 8332f0de2b) which added complexity to handle post-unmount
operations. Disabling the toggle is more direct and follows KISS principle.

Changes:
- Add disabled prop to ViewPicker based on isResponding state
- Revert mounted ref guards in use-chat-flow-control.ts
- Revert isMountedRef parameter in use-nodes/edges-interactions-without-sync.ts
- Revert defensive type check in markdown-utils.ts (no longer needed)
2026-01-27 01:31:22 +08:00
yyh
a0188bd9b5 fix(workflow)!: add mounted guard to prevent ReactFlow operations after unmount
When switching from graph view to skill view during an active preview run,
SSE callbacks continue executing and attempt to update ReactFlow node/edge
states. This could cause errors since the component is unmounted.

Add optional `isMountedRef` parameter to `useNodesInteractionsWithoutSync`
and `useEdgesInteractionsWithoutSync` hooks. When provided, operations are
skipped if the component has unmounted, preventing potential errors while
allowing the SSE connection to continue running in the background.

BREAKING CHANGE: `useNodesInteractionsWithoutSync` and
`useEdgesInteractionsWithoutSync` now accept an optional `isMountedRef`
parameter. Existing callers are unaffected as the parameter is optional.
2026-01-27 00:43:58 +08:00
yyh
a9c5201485 refactor(workflow)!: persist the debug state of the chatflow preview panel to the zustand store and split useChat hook into modular files 2026-01-26 23:21:44 +08:00
hjlarry
4c596aaac2 Merge branch 'feat/collaboration2' into feat/support-agent-sandbox 2026-01-25 00:00:03 +08:00
hjlarry
486a30402b remove forceUpload 2026-01-23 14:33:15 +08:00
hjlarry
e105dc6289 new restore 2026-01-23 14:22:58 +08:00
zhsama
ef8d0f497d feat: Merge parent workflow nodes into subgraph variable scope.And some
performance improve.
2026-01-23 06:56:59 +08:00
Joel
5657bf52f0 fix: can not save when switch to skill 2026-01-21 13:56:18 +08:00
hjlarry
511df81201 fix web style 2026-01-18 13:40:12 +08:00
hjlarry
434f7f3bcb fix web style 2026-01-17 22:10:10 +08:00
hjlarry
91e6ae2a7d fix bug 2026-01-17 14:53:33 +08:00
hjlarry
fc291e4ca2 Merge remote-tracking branch 'myori/main' into feat/collaboration2 2026-01-17 10:22:41 +08:00
zhsama
691554ad1c feat: 展示@agent引用 2026-01-15 23:32:14 +08:00
zhsama
e89d4e14ea Merge branch 'main' into feat/pull-a-variable 2026-01-15 16:14:15 +08:00
hjlarry
802b38eede fix 2026-01-15 13:16:35 +08:00
wangxiaolei
d095bd413b fix: fix LOOP_CHILDREN_Z_INDEX (#30719) 2026-01-14 10:22:31 +08:00
zhsama
96ec176b83 feat: sub-graph to use dynamic node generation 2026-01-13 22:28:30 +08:00
Novice
5bcd3b6fe6 feat: add mention node executor 2026-01-08 17:36:21 +08:00
zhsama
760a739e91 Merge branch 'main' into feat/grouping-branching
# Conflicts:
#	web/package.json
2026-01-06 22:00:01 +08:00
zhsama
d92c476388 feat(workflow): enhance group node availability checks
- Updated `checkMakeGroupAvailability` to include a check for existing group nodes, preventing group creation if a group node is already selected.
- Modified `useMakeGroupAvailability` and `useNodesInteractions` hooks to incorporate the new group node check, ensuring accurate group creation logic.
- Adjusted UI rendering logic in the workflow panel to conditionally display elements based on node type, specifically for group nodes.
2026-01-06 02:07:13 +08:00
zhsama
9012dced6a feat(workflow): improve group node interaction handling
- Enhanced `useNodesInteractions` to better manage group node handlers and connections, ensuring accurate identification of leaf nodes and their branches.
- Updated logic to create handlers based on node connections, differentiating between internal and external connections.
- Refined initial node setup to include target branches for group nodes, improving the overall interaction model for grouped elements.
2026-01-05 17:42:31 +08:00
zhsama
50bed78d7a feat(workflow): add group node support and translations
- Introduced GroupDefault node with metadata and default values for group nodes.
- Enhanced useNodeMetaData hook to handle group node author and description using translations.
- Added translations for group node functionality in English, Japanese, Simplified Chinese, and Traditional Chinese.
2026-01-05 16:29:00 +08:00
zhsama
60250355cb feat(workflow): enhance group edge management and validation
- Introduced `createGroupInboundEdges` function to manage edges for group nodes, ensuring proper connections to head nodes.
- Updated edge creation logic to handle group nodes in both inbound and outbound scenarios, including temporary edges.
- Enhanced validation in `useWorkflow` to check connections for group nodes based on their head nodes.
- Refined edge processing in `preprocessNodesAndEdges` to ensure correct handling of source handles for group edges.
2026-01-05 15:48:26 +08:00