refactor(task): rebuild Community async task system - #2659
openai0229 wants to merge 28 commits into
Conversation
There was a problem hiding this comment.
Reviewed 301a174.
Findings: 0 critical, 0 high, 1 medium.
Merge recommendation: non-blocking follow-up requested for the tracked-task recovery parameter mismatch.
Coverage limit: this PR changes 276 files; review prioritized the GitHub-provided patches for task lifecycle, cancellation, storage, artifacts, controller routing, task-center pagination, polling, and exit coordination. No tests or runtime checks were run.
``
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
awmgmcpg
To allow these domains, add them to the
network.allowedlist in your workflow frontmatter:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
Generated by AI Pull Request Reviewer for #2659 · 24.6 AIC · ⌖ 2.84 AIC · ⊞ 17.3K
| const results = await Promise.all( | ||
| missingTaskIds.map(async (taskId) => { | ||
| try { | ||
| return await loadDetails({ id: taskId }); |
There was a problem hiding this comment.
[medium] This recovery request uses { id: taskId }, but getTaskDetails was changed in this PR to accept TaskIdParams and /api/tasks/get validates a taskId field. When a previously tracked task is no longer in the current visible page (for example, it completes after enough newer tasks were created), this call is rejected, the catch converts it to an unresolved ID, and polling can continue indefinitely without showing the task terminal state. Change the loader contract and invocation to pass { taskId }, matching the fixed endpoint request object.
…ot-task-architecture # Conflicts: # chat2db-community-client/package.json # chat2db-community-client/scripts/i18n-source-hashes.json # chat2db-community-client/src/pages/main/workspace/components/WorkspaceLeftActionBar/index.tsx
…ot-task-architecture
…ot-task-architecture
…ot-task-architecture # Conflicts: # chat2db-community-client/package.json # chat2db-community-server/chat2db-community-jcef/src/main/java/ai/chat2db/community/jcef/handler/biz/update/RestartAppHandler.java
|
This PR has been split into focused review units:
The four branches were merged in a temporary integration worktree. The resulting Git tree is 4410af5b6767d758b2fecf16bb45b5ec95411175, exactly matching this PR head 2b29eca, with an empty tree diff. Closing this PR as superseded so review can continue on the focused PRs. |
Related issue
Closes #2658
Summary
This PR replaces the legacy Community task implementation with one asynchronous task system shared by query-result export, table-data export, SQL export, SQL-file import, and data-file import.
The backend now owns task lifecycle transitions, ordered events, bounded execution, cooperative cancellation, artifacts, restart reconciliation, and user-exit failure reasons. Task snapshots and per-task event streams are stored under the isolated
task-v2directory, intentionally without migrating legacy task data.The frontend provides a compact task center with active/completed indicators, paged newest-first logs, progress, download, delete, and artifact cleanup. Export tasks emit periodic progress logs, and Excel exports split across sheets before reaching format limits.
Community desktop navigation and workspace actions now live in the title bar with consistent Lucide controls, theme-colored active states, a default AI panel, width-based panel persistence, native macOS fullscreen synchronization, and safer JCEF development readiness checks. Dashboard initialization and legacy workspace-layout hydration are handled at their owning boundaries.
Desktop exit requests are correlated by operation ID. Restart preparation occurs only after the user confirms exit, overlapping requests cannot replace the pending action, and cancellation clears the native request without consuming the restart gate. Running tasks are still marked failed with the user-exit reason before the confirmed process exit.
Affected surfaces
Verification
yarn build:web:community: passed, including the Community prebuild suite, task-center tests, application-exit tests, production build, and bundle verification.mvn ... -Dmaven.test.skip=false -DskipTests=false test: passed for the 10-module reactor covering tools, domain API/core, SPI, storage, web, and JCEF; JCEF ran 54 tests and web ran 59 tests with no failures.bash -n script/dev-community-jcef.sh: passed.git diff --check: passed.Risk and compatibility
task-v2; legacy task JSON is neither migrated nor deleted.TaskExecutionContextinstead ofAsyncContext. Implementations were updated across supported Community plugins, but plugin-specific export paths remain the broadest regression surface.Reviewer map
TaskServiceImpl,LocalTaskManager,TaskRunner,TaskExecutionContextImpl,FileTaskStorage, andTaskController.TaskCentercomponents.CommunityTitleBarActions,AppTitleBar,CustomLayout, workspace persistence, andMainJFramefullscreen events.ApplicationExitCoordinator,RestartAppHandler, confirm/cancel handlers, anduseApplicationExit.Contributor declaration
AI assistance: Substantial AI assistance was used for architecture design, implementation, tests, debugging, and review. The contributor manually reviewed and tested the resulting behavior.