From 4e4c71ef294475244d2d6d54fd5d1dc6506423d9 Mon Sep 17 00:00:00 2001 From: nonoqing Date: Sun, 20 Sep 2026 16:56:41 +0800 Subject: [PATCH 1/3] fix(scheduled-jobs): surface agent-created jobs in the product surfaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A scheduled job created from a session through the Cron tool stayed invisible even though the backend reported success: the tool call rendered as a generic card, no open view was told to re-read the job list, and the workspace-scoped list filtered to workspace-targeted jobs — the one kind the agent cannot create. Agents can also create a job with "enabled": false, which the nav count skipped entirely. - Render a dedicated Cron tool card in the chat transcript (design-system card plus the web-ui adapter, registry entry, and copy). - Emit cron://jobs-changed from the cron service on create, update, delete, and run-state changes; mirror it to Peer Device controllers and let the scheduled-jobs surfaces reload from the hint. - List every job in the workspace, with its target, in the scheduled-jobs views and in the agent's own cron_jobs list, instead of hiding session-targeted jobs behind a target-kind filter. - Count scheduled jobs per workspace and per session in the nav, disabled jobs included, matching what the panels list. --- .../flow-chat/tool-cards/SessionToolCards.tsx | 9 +- .../tool-cards/StandardToolCards.meta.ts | 10 + .../ui/src/flow-chat/tool-cards/index.ts | 2 + design-system/packages/ui/src/registry.ts | 2 + .../ui/tests/flow-chat-tool-card.test.mjs | 6 + .../packages/ui/tests/registry.test.mjs | 1 + .../desktop/src/api/remote_connect_api.rs | 7 + .../tools/implementations/cron_tool.rs | 143 ++++++++-- .../assembly/core/src/service/cron/events.rs | 67 +++++ .../assembly/core/src/service/cron/mod.rs | 2 + .../assembly/core/src/service/cron/service.rs | 52 +++- src/crates/assembly/core/src/service/mod.rs | 3 +- .../sections/sessions/SessionsSection.scss | 16 ++ .../sections/sessions/SessionsSection.tsx | 22 ++ .../sections/workspaces/WorkspaceItem.tsx | 21 ++ .../scheduled-jobs/ScheduledJobsView.tsx | 20 +- .../scheduled-jobs/cronJobCountsStore.test.ts | 88 ++++++ .../scheduled-jobs/cronJobCountsStore.ts | 131 +++++++++ .../src/app/scenes/todos/TodosScene.tsx | 4 +- .../src/flow_chat/tool-cards/CronToolCard.tsx | 270 ++++++++++++++++++ .../src/flow_chat/tool-cards/index.test.ts | 1 + src/web-ui/src/flow_chat/tool-cards/index.ts | 4 + .../flow_chat/tool-cards/toolCardMetadata.ts | 13 + .../infrastructure/api/service-api/CronAPI.ts | 13 + .../peer-device/deviceSurfaceRouting.test.ts | 1 + .../peer-device/deviceSurfaceRouting.ts | 1 + src/web-ui/src/locales/en-US/common.json | 4 +- src/web-ui/src/locales/en-US/flow-chat.json | 37 +++ src/web-ui/src/locales/zh-CN/common.json | 4 +- src/web-ui/src/locales/zh-CN/flow-chat.json | 37 +++ src/web-ui/src/locales/zh-TW/common.json | 4 +- src/web-ui/src/locales/zh-TW/flow-chat.json | 37 +++ 32 files changed, 984 insertions(+), 48 deletions(-) create mode 100644 src/crates/assembly/core/src/service/cron/events.rs create mode 100644 src/web-ui/src/app/components/scheduled-jobs/cronJobCountsStore.test.ts create mode 100644 src/web-ui/src/app/components/scheduled-jobs/cronJobCountsStore.ts create mode 100644 src/web-ui/src/flow_chat/tool-cards/CronToolCard.tsx diff --git a/design-system/packages/ui/src/flow-chat/tool-cards/SessionToolCards.tsx b/design-system/packages/ui/src/flow-chat/tool-cards/SessionToolCards.tsx index db3f563f18..778ab967ce 100644 --- a/design-system/packages/ui/src/flow-chat/tool-cards/SessionToolCards.tsx +++ b/design-system/packages/ui/src/flow-chat/tool-cards/SessionToolCards.tsx @@ -1,6 +1,6 @@ import { OverflowText } from '../../primitives/OverflowText'; import type { HTMLAttributes, ReactNode } from "react"; -import { Layers, MessageSquare } from "lucide-react"; +import { CalendarClock, Layers, MessageSquare } from "lucide-react"; import { AmbientToolCard, AmbientToolCardHeader, @@ -124,3 +124,10 @@ export interface SessionMessageToolCardProps export function SessionMessageToolCard(props: SessionMessageToolCardProps) { return