Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
fix(scheduled): read each task's own newest run for the task column
Hanawa6a8880bbfa1c
diff --git a/apps/desktop/electron/main/ipc/scheduled-ipc.ts b/apps/desktop/electron/main/ipc/scheduled-ipc.tsindex 9655a5e41..a93b0fcea 100644--- a/apps/desktop/electron/main/ipc/scheduled-ipc.ts+++ b/apps/desktop/electron/main/ipc/scheduled-ipc.ts@@ -18,12 +18,13 @@ export function registerScheduledIpc({invoke,isQuitting,}: ScheduledIpcDependencies): void {- // The Scheduled workspace renders one task's own history, so the caller may- // scope the read to a single task. The host owns the 1..200 bound and the- // default, so the request only forwards a validated scope and limit.+ // The Scheduled workspace renders one task's own history and one newest run+ // per task for the column, so the caller may scope or summarize the read. The+ // host owns the 1..200 bound and the default, so the request only forwards a+ // validated shape.registrar.handle(IPC.invoke.scheduledListRuns,- async (options: { taskId?: unknown; limit?: unknown } = {}) => {+ async (options: { taskId?: unknown; limit?: unknown; latestPerTask?: unknown } = {}) => {const host = getHost();if (!host) throw new Error("host unavailable");const taskId = typeof options?.taskId === "string" ? options.taskId.trim() : "";@@ -32,6 +33,7 @@ export function registerScheduledIpc({throw new Error("invalid scheduled run limit");}return host.call("scheduled.listRuns", {+ ...(options?.latestPerTask === true ? { latestPerTask: true } : {}),...(taskId ? { taskId } : {}),...(limit === undefined ? {} : { limit: Math.trunc(limit) }),});diff --git a/apps/desktop/src/features/scheduled/use-scheduled-workspace.ts b/apps/desktop/src/features/scheduled/use-scheduled-workspace.tsindex 8fd40f4f3..cf4447f71 100644--- a/apps/desktop/src/features/scheduled/use-scheduled-workspace.ts+++ b/apps/desktop/src/features/scheduled/use-scheduled-workspace.ts@@ -8,8 +8,8 @@ import { peekScheduledReturn } from "./scheduled-return";/** Same cadence the page always used: the host owns admission, the page only* reflects it. */const REFRESH_INTERVAL_MS = 10_000;-/** One read feeds every task row's last outcome; the host bounds it at 200. */-const RAIL_RUN_LIMIT = 100;+/** What each task row reports: the host answers one newest run per task, so a+ * task idle while others produced runs never reads as never run. *//** The selected task's own history, which the run panel reads. */const TASK_RUN_LIMIT = 200;@@ -48,7 +48,7 @@ export function useScheduledWorkspace(// Coming back from a run's conversation restores the same task and run.const restored = peekScheduledReturn();const [tasks, setTasks] = useState<ScheduledTask[]>([]);- const [recentRuns, setRecentRuns] = useState<ScheduledTaskRun[]>([]);+ const [latestPerTaskRuns, setLatestPerTaskRuns] = useState<ScheduledTaskRun[]>([]);const [taskRuns, setTaskRuns] = useState<ScheduledTaskRun[]>([]);const [projects, setProjects] = useState<ProjectRecord[]>([]);const [selectedTaskId, setSelectedTaskId] = useState<string | null>(restored?.taskId ?? null);@@ -76,12 +76,12 @@ export function useScheduledWorkspace(try {const [taskResult, runResult, projectResult] = await Promise.all([api.listScheduled(),- api.listScheduledRuns({ limit: RAIL_RUN_LIMIT }),+ api.listScheduledRuns({ latestPerTask: true }),api.listProjects().catch(() => ({ projects: [] as ProjectRecord[] })),]);if (!mounted.current || request !== revision.current) return;setTasks(taskResult.tasks);- setRecentRuns(runResult.runs);+ setLatestPerTaskRuns(runResult.runs);setProjects(projectResult.projects);setError("");setLoaded(true);@@ -147,7 +147,7 @@ export function useScheduledWorkspace([tasks, selectedTaskId],);const runs = useMemo(() => runsForTask(taskRuns, selectedTaskId), [taskRuns, selectedTaskId]);- const latestRuns = useMemo(() => latestRunByTask(recentRuns), [recentRuns]);+ const latestRuns = useMemo(() => latestRunByTask(latestPerTaskRuns), [latestPerTaskRuns]);const action = useCallback(async (work: () => Promise<void>): Promise<boolean> => {@@ -212,7 +212,10 @@ export function useScheduledWorkspace(const selectTask = useCallback((taskId: string) => setSelectedTaskId(taskId), []);const selectRun = useCallback((runId: string) => setSelectedRunId(runId), []);- const runningFor = useCallback((taskId: string) => taskIsRunning(recentRuns, taskId), [recentRuns]);+ const runningFor = useCallback(+ (taskId: string) => taskIsRunning(latestPerTaskRuns, taskId),+ [latestPerTaskRuns],+ );return {tasks,diff --git a/apps/desktop/src/lib/api.ts b/apps/desktop/src/lib/api.tsindex 06967c0c4..904c0f34a 100644--- a/apps/desktop/src/lib/api.ts+++ b/apps/desktop/src/lib/api.ts@@ -894,8 +894,12 @@ export const api = {invoke<{ task: ScheduledTask }>(IPC.invoke.scheduledUpdate, input),deleteScheduled: (id: string) => invoke(IPC.invoke.scheduledDelete, id),executeScheduled: (id: string) => invoke<{ sessionId: string }>(IPC.invoke.scheduledExecute, id),- listScheduledRuns: (options: { taskId?: string; limit?: number } = {}) =>- invoke<{ runs: ScheduledTaskRun[] }>(IPC.invoke.scheduledListRuns, options),+ listScheduledRuns: (options: {+ taskId?: string;+ limit?: number;+ /** One newest run per task, for the task column's own outcomes. */+ latestPerTask?: boolean;+ } = {}) => invoke<{ runs: ScheduledTaskRun[] }>(IPC.invoke.scheduledListRuns, options),runScheduled: (id: string) =>invoke<{ sessionId: string; prompt: string; task: ScheduledTask }>(IPC.invoke.scheduledRun,diff --git a/apps/desktop/test/scheduled-workspace.test.mjs b/apps/desktop/test/scheduled-workspace.test.mjsindex e66eeebc4..cb7c20070 100644--- a/apps/desktop/test/scheduled-workspace.test.mjs+++ b/apps/desktop/test/scheduled-workspace.test.mjs@@ -439,3 +439,22 @@ test("the task form owns the Scheduled page while it is open", async () => {assert.match(source, /loaded && tasks\.length > 0 && !editor \?/);assert.match(source, /className="scheduled-editor-slot"/);});++test("the task column reads one newest run per task, not a global window", async () => {+ // A global window drops an idle task's rows once other tasks fill it, and the+ // column then reports that task as never run. The host answers per task.+ const source = await readFile(+ new URL("../src/features/scheduled/use-scheduled-workspace.ts", import.meta.url),+ "utf8",+ );+ assert.match(source, /api\.listScheduledRuns\(\{ latestPerTask: true \}\)/);+ assert.doesNotMatch(source, /RAIL_RUN_LIMIT/);+ assert.match(+ source,+ /const \[latestPerTaskRuns, setLatestPerTaskRuns\]/,+ "the column's state is named for what it holds",+ );++ const api = await readFile(new URL("../src/lib/api.ts", import.meta.url), "utf8");+ assert.match(api, /latestPerTask\?: boolean/);+});diff --git a/crates/host-core/src/rpc/scheduled_rpc.rs b/crates/host-core/src/rpc/scheduled_rpc.rsindex 55ea9bd1d..57fd4fb42 100644--- a/crates/host-core/src/rpc/scheduled_rpc.rs+++ b/crates/host-core/src/rpc/scheduled_rpc.rs@@ -271,6 +271,24 @@ fn handle_with_workspace_policy(}"scheduled.listRuns" => {let task_id = params.get("taskId").and_then(|v| v.as_str());+ // The task column needs each task's own newest run: a global window+ // would report an idle task as "never run" once other tasks fill it.+ if params+ .get("latestPerTask")+ .and_then(Value::as_bool)+ .unwrap_or(false)+ {+ if task_id.is_some() {+ return Err(rpc_err(+ 1002,+ "latestPerTask cannot be scoped to a single task",+ "INVALID_PARAMS",+ ));+ }+ let runs = scheduled::latest_run_per_task(&st.db)+ .map_err(|e| rpc_err(1000, e.to_string(), "INTERNAL"))?;+ return Ok(json!({ "runs": runs }));+ }let limit = params.get("limit").and_then(|v| v.as_i64()).unwrap_or(50);let runs = scheduled::list_runs(&st.db, task_id, limit).map_err(|e| rpc_err(1000, e.to_string(), "INTERNAL"))?;@@ -901,4 +919,57 @@ mod tests {}assert!(scheduled::list_tasks(&state.db).unwrap().is_empty());}++ #[test]+ fn the_task_column_asks_for_one_newest_run_per_task() {+ let dir = tempfile::tempdir().unwrap();+ let mut st = AppState::open(dir.path()).unwrap();+ st.handshook = true;+ let create = |title: &str| {+ handle(+ &st,+ "scheduled.create",+ json!({ "title": title, "prompt": "Review", "cadence": "manual", "schedule": null }),+ )+ .unwrap()["task"]["id"]+ .as_str()+ .unwrap()+ .to_string()+ };+ let idle = create("Idle");+ let busy = create("Busy");+ // The idle task ran first; afterwards the busy one produced two runs.+ for (index, task) in [(0i64, &idle), (1, &idle), (2, &busy), (3, &busy)] {+ let started = 1_000 + index * 100;+ st.db+ .conn()+ .execute(+ &format!(+ "INSERT INTO task_runs+ (id, task_id, session_id, status, error_code, started_at, ended_at)+ VALUES ('run-{index}', '{task}', NULL, 'completed', NULL, {started}, {})",+ started + 500+ ),+ [],+ )+ .unwrap();+ }++ let scoped = handle(&st, "scheduled.listRuns", json!({ "latestPerTask": true })).unwrap();+ let runs = scoped["runs"].as_array().unwrap();+ assert_eq!(runs.len(), 2, "one run per task");+ assert_eq!(runs[0]["id"], "run-3");+ assert_eq!(+ runs[1]["id"], "run-1",+ "the idle task reports its own newest run"+ );++ let rejected = handle(+ &st,+ "scheduled.listRuns",+ json!({ "latestPerTask": true, "taskId": idle }),+ )+ .unwrap_err();+ assert_eq!(rejected.data.unwrap()["errorCode"], "INVALID_PARAMS");+ }}diff --git a/crates/host-core/src/scheduled.rs b/crates/host-core/src/scheduled.rsindex 338efb12d..f15aa2825 100644--- a/crates/host-core/src/scheduled.rs+++ b/crates/host-core/src/scheduled.rs@@ -494,38 +494,62 @@ pub fn finish_run(Ok(n > 0)}+fn run_from_row(row: &rusqlite::Row<'_>) -> rusqlite::Result<TaskRun> {+ Ok(TaskRun {+ id: row.get(0)?,+ task_id: row.get(1)?,+ session_id: row.get(2)?,+ status: row.get(3)?,+ error_code: row.get(4)?,+ started_at: ms_to_ts(row.get(5)?),+ ended_at: row.get::<_, Option<i64>>(6)?.map(ms_to_ts),+ })+}++/// Newest first. `task_id` scopes the read to one task's history; without it the+/// window spans every task and is bounded by `limit` (1..200).pub fn list_runs(db: &Database, task_id: Option<&str>, limit: i64) -> Result<Vec<TaskRun>> {let limit = limit.clamp(1, 200);- let map_row = |row: &rusqlite::Row<'_>| -> rusqlite::Result<TaskRun> {- Ok(TaskRun {- id: row.get(0)?,- task_id: row.get(1)?,- session_id: row.get(2)?,- status: row.get(3)?,- error_code: row.get(4)?,- started_at: ms_to_ts(row.get(5)?),- ended_at: row.get::<_, Option<i64>>(6)?.map(ms_to_ts),- })- };let mut out = Vec::new();if let Some(task_id) = task_id {let mut stmt = db.conn().prepare_cached("SELECT id, task_id, session_id, status, error_code, started_at, ended_atFROM task_runs WHERE task_id = ?1 ORDER BY started_at DESC LIMIT ?2",)?;- let rows = stmt.query_map(params![task_id, limit], map_row)?;+ let rows = stmt.query_map(params![task_id, limit], run_from_row)?;out.extend(rows.collect::<rusqlite::Result<Vec<_>>>()?);} else {let mut stmt = db.conn().prepare_cached("SELECT id, task_id, session_id, status, error_code, started_at, ended_atFROM task_runs ORDER BY started_at DESC LIMIT ?1",)?;- let rows = stmt.query_map(params![limit], map_row)?;+ let rows = stmt.query_map(params![limit], run_from_row)?;out.extend(rows.collect::<rusqlite::Result<Vec<_>>>()?);}Ok(out)}+/// The newest run of every task, whatever the size of the history table. The+/// task column reads this rather than a global window, so a task that has been+/// idle while other tasks produced hundreds of runs still reports its own last+/// outcome instead of "never run". Ties on `started_at` resolve the way the run+/// history orders them: by id, descending.+pub fn latest_run_per_task(db: &Database) -> Result<Vec<TaskRun>> {+ let mut stmt = db.conn().prepare_cached(+ "SELECT id, task_id, session_id, status, error_code, started_at, ended_at+ FROM task_runs+ WHERE rowid = (+ SELECT rowid FROM task_runs AS newer+ WHERE newer.task_id = task_runs.task_id+ ORDER BY newer.started_at DESC, newer.id DESC+ LIMIT 1+ )+ ORDER BY started_at DESC",+ )?;+ let rows = stmt.query_map([], run_from_row)?;+ Ok(rows.collect::<rusqlite::Result<Vec<_>>>()?)+}+#[cfg(test)]mod tests {use super::*;@@ -670,4 +694,48 @@ mod tests {assert_eq!(config["mode"], "plan");assert_eq!(config["notify"], true);}++ #[test]+ fn the_task_column_reads_each_tasks_own_newest_run() {+ let db = test_db();+ let idle = create_task(&db, &json!({ "prompt": "idle", "cadence": "daily" })).unwrap();+ let busy = create_task(&db, &json!({ "prompt": "busy", "cadence": "daily" })).unwrap();+ let insert = |id: &str, task: &str, started: i64| {+ db.conn()+ .execute(+ "INSERT INTO task_runs+ (id, task_id, session_id, status, error_code, started_at, ended_at)+ VALUES (?1, ?2, NULL, 'completed', NULL, ?3, ?4)",+ params![id, task, started, started + 500],+ )+ .unwrap();+ };+ // The idle task ran first; afterwards the busy one piled up 120 runs.+ insert("run-idle-1", &idle.id, 1_000);+ insert("run-idle-2", &idle.id, 2_000);+ for index in 0..120 {+ insert(+ &format!("run-busy-{index:03}"),+ &busy.id,+ 10_000 + i64::from(index) * 1_000,+ );+ }++ // A global window drops the idle task entirely — the defect the task+ // column used to inherit from the shared read.+ let window = list_runs(&db, None, 100).unwrap();+ assert_eq!(window.len(), 100);+ assert!(+ window.iter().all(|run| run.task_id == busy.id),+ "the newest 100 rows all belong to the busy task"+ );++ // One newest run per task reports both tasks, newest first.+ let latest = latest_run_per_task(&db).unwrap();+ assert_eq!(+ latest.iter().map(|run| run.id.as_str()).collect::<Vec<_>>(),+ vec!["run-busy-119", "run-idle-2"]+ );+ assert_eq!(latest[1].started_at, ms_to_ts(2_000));+ }}diff --git a/docs/spec/03-runtime/04-data-storage.md b/docs/spec/03-runtime/04-data-storage.mdindex 02dfba58e..9cca79a90 100644--- a/docs/spec/03-runtime/04-data-storage.md+++ b/docs/spec/03-runtime/04-data-storage.md@@ -1133,6 +1133,12 @@ The ownership is derived on read and never stored on the session row, so theSessionList and session search hide the transcript while it has a run, anddeleting the task returns it to the ordinary lists instead of leaving itunreachable (issue #1291).+`scheduled.listRuns` answers two shapes: one task's own history (`taskId`, at most+200 rows) and one newest run per task (`latestPerTask`, one row per task, never+combined with `taskId`). The task column reads the second shape. A global window+over `task_runs` can be filled by one busy task — retention keeps the last 100+runs *per task* — and would then report an idle task as never run, so the read+that feeds the column is per task rather than a shared window.The existing JSON extension stores `schedule: {hour, minute, weekday}`,`intervalMinutes` (5–1440; required by an `interval` cadence and read by no otherone, so a schedule that keeps the field keeps its value), `nextRunAt` (epochdiff --git a/docs/spec/04-ux/01-ui-ia.md b/docs/spec/04-ux/01-ui-ia.mdindex dc4388616..003f925cf 100644--- a/docs/spec/04-ux/01-ui-ia.md+++ b/docs/spec/04-ux/01-ui-ia.md@@ -256,13 +256,15 @@ and survives other form edits until the user explicitly selects a preset. Weeklyseparate dropdown listing Monday through Sunday with selection markers.Each day toggles independently; there are no preset combinations. An emptyselection disables saving. The menu supports arrows, Home/End, Enter/Space,-Escape/outside dismissal, and exposes selected states. The column reports eachEscape/outside dismissal, exposes selected states, and owns the page while it isopen: the task column and the task page step aside rather than compete with thedraft. The form also states an interval as a count with a minute or hour unit(5 minutes to 24 hours) and keeps that value while another cadence is selected,-so switching a task between a calendar and an interval loses neither.-task's cadence and clock, the outcome of its newest run with its duration, and+so switching a task between a calendar and an interval loses neither. The column+reports each task's cadence and clock, the outcome of that task's own newest run+— read per task from the host, so a task that has been idle while others ran is+never reported as never run — with its duration, and whether it is paused or+running.whether it is paused or running. The task page shows that task's last run, nextoccurrence, project, permission and model, its instruction behind a disclosure,its own run history newest first (status, start time, duration, stable errordiff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.mdindex c6d44913f..210448c34 100644--- a/docs/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/spec/06-delivery/04-e2e-test-plan.md@@ -419,6 +419,8 @@span instead of a clock, then switch to a weekly cadence and back to confirmthe value survived; open the edit form and verify the task column and the taskpage step aside;+ then let one task accumulate more runs than the shared window while another+ stays idle, and verify the idle task still reports its own last outcome;and read the admitted run's transcript inside the task page; open the resultconversation from that page and verify its top bar offers the way back to thescheduled task; return and confirm the same task and run are still selected;@@ -437,7 +439,9 @@reaches the persisted transcript while the SessionList and session search neverlist it, that conversation's top bar returns to the same task and run, aninterval task arms from the span the form states and reports it in its row,- the task form owns the page while it is open, and+ the task form owns the page while it is open, a task that stayed idle while+ another accumulated more runs than the shared window still reports its own+ last outcome, andautomatic execution does not require arenderer prompt. Host tests additionally prove duplicate admission rejection,stale/missed occurrence handling, invalid input rejection and recovery.diff --git a/docs/zh-CN/spec/03-runtime/04-data-storage.md b/docs/zh-CN/spec/03-runtime/04-data-storage.mdindex 79c64a15d..edb67d488 100644--- a/docs/zh-CN/spec/03-runtime/04-data-storage.md+++ b/docs/zh-CN/spec/03-runtime/04-data-storage.md@@ -914,7 +914,9 @@ CREATE INDEX idx_task_runs ON task_runs(task_id, started_at DESC);生成会话的运行通过 `session_id` 免费获取其转录本。该转录本通过针对 `task_runs` 的 `EXISTS` 判断被识别为自动化产出,每个会话摘要与搜索命中都以 `scheduledRun` 返回这一归属。归属在读取时派生、不写入会话行:因此在该会话仍属于某次运行时,会话列表与会话搜索会隐藏它;删除任务后它会回到普通列表,而不会变得无法访问(issue #1291)。-`config_json` 保存 `schedule: {hour, minute, weekday}`、`intervalMinutes`(5–1440,只有 `interval` 周期读取,因此保留该字段的排程会保留它的值)、毫秒时间戳 `nextRunAt`、+`scheduled.listRuns` 提供两种形状:单任务自己的历史(`taskId`,最多 200 条)与每任务最新一次运行(`latestPerTask`,每个任务一行,不能与 `taskId` 同时使用)。任务列读取后者:`task_runs` 的全局窗口可能被某个繁忙任务填满(保留策略是按任务各留最近 100 条),那样空闲任务会被误报为「尚未运行」,所以喂给任务列的读取按任务而不是共享窗口。++`config_json` 保存 `schedule: {hour, minute, weekday}``workspacePath`、会话模式 `sessionMode`(`perRun` 或 `reuse`,缺失按 `perRun`),以及可选的任务级 `permissionMode` 与成对的 `providerId`/`modelId`。这些新增字段无需物理表迁移。缺少模型字段时仍在运行时读取应用默认值;缺少权限字段时,自动运行继续使用 Ask,立即运行继续继承全局权限。每天、每周按宿主本地时区计算;每小时与间隔按准入时刻起算的经过时间计算:每小时采用 `nextRunAt = now + 3_600_000`,间隔采用 `nextRunAt = now + intervalMinutes × 60_000`,两者都忽略日历时间字段。diff --git a/docs/zh-CN/spec/04-ux/01-ui-ia.md b/docs/zh-CN/spec/04-ux/01-ui-ia.mdindex 12b43f755..7f870884f 100644--- a/docs/zh-CN/spec/04-ux/01-ui-ia.md+++ b/docs/zh-CN/spec/04-ux/01-ui-ia.md@@ -210,7 +210,7 @@选择及 Escape/外部点击关闭,选项具有选中状态语义。表单打开时独占本页:任务列与任务页面让位,不与草稿争夺空间;间隔值在切换到其他周期时保留,日历与间隔之间来回切换都不会丢失。每天、每周按电脑本地时区计算并显示下次执行时间。-任务列显示每个任务的周期与时间、最近一次运行的结果与耗时,以及暂停或运行中状态;任务页面显示该任务的上次运行、下次执行、项目、权限与模型,指令默认折叠,运行记录只列本任务的运行(状态、开始时间、耗时与稳定错误码,最新在前),并在页内按有界读取展示所选运行的转写。运行的转写属于本页面:会话列表与全局搜索不再列出它,只有“打开会话”这个显式动作才会把它带入对话页,对话顶部栏随后为这段会话提供返回入口(入口标注它所属的任务;返回后仍选中同一个任务与同一次运行,若本页紧邻其后则直接复用导航历史)。侧边栏时钟与全局搜索均可进入。立即运行在后台执行并选中刚准入的那次运行,读者仍停留在本页。+任务列显示每个任务的周期与时间、该任务自己最新一次运行的结果与耗时(逐任务读取,不会因为其他任务的运行挤占窗口而误报「尚未运行」),以及暂停或运行中状态;应用必须保持运行。每 30 秒检查一次,超过 90 秒的错过时段与重叠运行被跳过;重启只安排未来时段。旧任务需明确保存周期后才自动执行。新任务保存所选项目、Ask 权限和当前默认 provider/model;这些值只属于当前任务。任务文本标为“指令”,项目、权限和模型选择器嵌在指令框底部,并复用主 Composer 的容器、芯片和锚定菜单样式。两处直接共用权限选择组件和支持搜索、服务商分组、能力标记的模型列表。任务的模型按钮只显示模型名或别名,不拼接服务商名称;选择结果只更新任务草稿,不更改当前对话或应用默认设置。指令输入区域使用独立圆角边框及与底栏不同的底色,不显示原生缩放手柄,长文本在输入区内滚动。缺少模型字段的旧任务继续跟随应用默认值,已保存但不可用的模型保留显示且不会被静默替换。选择 Auto 时明确提示受限操作可能无需询问。没有显式选择时,首次设置仍保存当前项目,diff --git a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.mdindex b034a6942..f74bdcbfa 100644--- a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md@@ -8718,10 +8718,11 @@ the latest destination. These assertions measure work counts, not device FPS.验证方向键、Home/End、Enter、Escape/Tab 和外部点击关闭;验证每小时无时间输入且首次等待一小时;设置每天任务在下一个真实分钟执行;选择间隔周期并填入 30 分钟,确认任务行显示该跨度而不是时钟,再切到每周周期后切回,确认该值仍然保留;打开编辑表单,确认任务列与任务页面让位;+ 让一个任务积累超过共享窗口的运行记录、另一个任务保持空闲,确认空闲任务仍然显示自己的最近一次结果;观察自动完成;删除已结束的任务。普通 Agent 对话经模型工具调用发现、创建、查询、修改任务到 15:30,再删除;验证页面显示具体时间,改名保存不覆盖。模型为本地确定性夹具。- **预期:** 项目、权限和精确 provider/model 只保存在该任务,重新打开仍显示相同值并实际传到 sidecar,其他任务不受影响;项目、权限和模型控件保持嵌在“指令”框的 Composer 风格底栏中,窄窗口也不产生横向溢出;缺少新增字段的旧记录保持原默认行为。配置持久化并显示下次时间;暂停后不触发;手动与自动入口均调用真实- Agent sidecar;本任务的运行记录列出每次运行的状态与耗时,「打开会话」到达持久化会话,而会话列表与会话搜索不会列出它,该会话顶部栏可返回同一个任务与同一次运行;间隔任务按表单给出的跨度排程并在任务行中显示,表单打开时独占本页;自动执行不依赖渲染器发送提示词。+ Agent sidecar;本任务的运行记录列出每次运行的状态与耗时,「打开会话」到达持久化会话,而会话列表与会话搜索不会列出它,该会话顶部栏可返回同一个任务与同一次运行;间隔任务按表单给出的跨度排程并在任务行中显示,表单打开时独占本页;让一个任务积累超过共享窗口的运行记录、另一个保持空闲时,空闲任务仍显示自己的最近一次结果;自动执行不依赖渲染器发送提示词。宿主测试补充验证重复准入、错过时段、无效输入和重启恢复。- **规格:** 04-ux/01-ui-ia §3.3;04-ux/08-component-spec §6、§20A;03-runtime/04-data-storage §4.11;ADR scheduled-desktop-automations;ADR 0305。