From 62637f428eaece806cf76a26e1d405352c9ea269 Mon Sep 17 00:00:00 2001 From: yi-ge Date: Wed, 26 Aug 2026 22:19:58 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E5=A2=9E=E5=8A=A0=E9=95=BF=E8=80=97?= =?UTF-8?q?=E6=97=B6=E4=BB=BB=E5=8A=A1=E4=BD=BF=E7=94=A8=E6=8C=87=E5=8D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../04-delegation/03-execution-monitoring.md | 4 + .../04-delegation/07-long-running-tasks.md | 216 ++++++++++++++++++ .../04-delegation/03-execution-monitoring.md | 4 + .../04-delegation/07-long-running-tasks.md | 214 +++++++++++++++++ 4 files changed, 438 insertions(+) create mode 100644 docs/02-user-guide/04-delegation/07-long-running-tasks.md create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/02-user-guide/04-delegation/07-long-running-tasks.md diff --git a/docs/02-user-guide/04-delegation/03-execution-monitoring.md b/docs/02-user-guide/04-delegation/03-execution-monitoring.md index 44cc801..50e2b62 100644 --- a/docs/02-user-guide/04-delegation/03-execution-monitoring.md +++ b/docs/02-user-guide/04-delegation/03-execution-monitoring.md @@ -246,3 +246,7 @@ keywords: [执行, 监控, 固化步骤, 灵活步骤, 暂停, 恢复, 进度, :::info 下一步 在执行过程中,某些高风险操作会触发"人闸门"确认。前往 [人闸门确认机制](./04-human-gate.md) 了解详情。 ::: + +:::tip 任务可能运行半小时或更久? +参见[长耗时任务](./07-long-running-tasks.md),了解怎样要求智能体保存阶段进度、在后台运行命令,以及中断后从已有成果继续。 +::: diff --git a/docs/02-user-guide/04-delegation/07-long-running-tasks.md b/docs/02-user-guide/04-delegation/07-long-running-tasks.md new file mode 100644 index 0000000..ba6e1fe --- /dev/null +++ b/docs/02-user-guide/04-delegation/07-long-running-tasks.md @@ -0,0 +1,216 @@ +--- +title: 长耗时任务 +description: 使用全局任务板跟踪构建、训练、批量处理、长篇研究等耗时工作,并在中断后从已有进度继续。 +keywords: [长任务, 后台任务, 全局任务板, 任务管理器, 阶段进度, 断点继续, 构建, 训练, 批量处理] +sidebar_position: 7 +last-reviewed: 2026-08-26 +--- + +# 长耗时任务 + +有些工作本来就急不得。比如分析几百份文件、跑一次完整构建、训练模型、求解大规模排程,或者做一轮需要反复查资料的研究。它们可能要半小时,也可能要几个小时。 + +把这类任务交给智能体时,最重要的不是猜一个足够长的等待时间,而是让它把进度留在工作目录里。这样即使网络波动、应用重启或任务中途失败,智能体也能先检查已有成果,再接着做。 + +## 一段可以直接复制的话 + +第一次交代长任务,可以在原任务后面加上这段: + +```text +这是一项长耗时任务。开始前先列出计划,并把工作拆成几个可以独立验收的阶段。 +每完成一个阶段,就把结果保存到工作目录并更新进度记录,不要只在聊天里说“已完成”。 +如果中途失败或重新开始,先检查已有文件和进度,从最后一个已完成的阶段继续,不要从头重做。 +遇到会覆盖文件、对外发送、发布或产生费用的操作,先问我。 +``` + +有了这几句,智能体会先分段,把阶段成果写进文件;恢复时先查已有进度,高风险动作仍然等你确认。 + +如果你经常做长任务,可以把这套要求[教给智能体](../03-teaching/03-teach-rules.md),以后不用每次重复。 + +## 把阶段放进全局任务板 + +聊天里的任务清单适合看当前对话。任务一旦跨越几个小时、多个对话,或者需要多个智能体协作,就应该放进“全局任务板”。这样你不必回到原聊天翻记录,也能看到谁在做、哪里被卡住、哪些结果等你确认。 + +可以直接补一句: + +```text +请为这项工作创建或使用一个全局任务板。 +把每个可以独立验收的阶段建成一条任务,写清负责人、完成条件、成果文件和前置依赖。 +开始处理时更新为“进行中”;遇到问题时更新为“阻塞”并写明原因;做完后先提交“待确认”,等我验收后再标记“已完成”。 +每次状态变化都及时更新任务板,不要等全部做完后一次性补记录。 +``` + +一项批量合同分析,可以在任务板里这样拆: + +| 任务 | 负责人 | 完成条件 | 前置任务 | +|---|---|---|---| +| 统计并校验输入文件 | 合同助手 | 文件数量和失败清单已保存 | 无 | +| 分批抽取合同文本 | 文档助手 | 每份合同都有可读取文本或失败原因 | 输入校验 | +| 检查风险条款 | 合同助手 | 风险结果逐份落表 | 文本抽取 | +| 汇总并提交报告 | 合同助手 | 报告和汇总表进入待确认 | 风险检查 | + +不要把“分析 300 份合同”只建成一条巨大的“进行中”任务。那样过了两个小时,你仍然不知道是抽取慢、检查被阻塞,还是报告已经做好只等确认。 + +### 在全局任务板里怎么看 + +打开左侧导航的“全局任务板”,切到“任务总览”: + +- “全部任务”适合搜索任务名称、范围、状态、优先级和参与智能体; +- “按负责人”会按智能体或团队分组,能看到各自的任务总数、执行中、阻塞、审核和逾期数量; +- “待处理”集中展示待开始、遇到阻碍、等待智能体确认、等待你确认、自动处理失败和需要人工接手的事项。 + +选中某个任务板后,切到“当前任务板”。这里可以用看板或列表查看任务,按状态、负责人、优先级、到期时间等条件筛选。需要了解为什么不能继续时,查看任务的前置阻塞、评论和关联记录,不要只看一个百分比。 + +对长任务来说,最值得每天看的是“进行中”“阻塞”和“待确认”: + +- “进行中”应该能找到负责人和最近更新; +- “阻塞”应该写明缺什么、谁能处理,不能只写“出错了”; +- “待确认”表示阶段成果已经交付,等你验收,不等于整项工作已经完成。 + +### 全局任务板和任务管理器不是一回事 + +| 入口 | 记录什么 | 适合做什么 | +|---|---|---| +| 聊天中的任务清单 | 当前对话里的关键工作项 | 在聊天时快速看进度 | +| 全局任务板 | 跨对话、跨智能体的业务阶段、负责人、阻塞和审核 | 管理“事情做到哪了” | +| 任务管理器 | 正在运行的 Agent Run、后台命令、终端和内部宿主 | 管理“什么程序还在跑” | +| 终端面板 | 某个终端的完整输出和交互 | 查看详细日志或继续输入 | + +这一区分很重要。在全局任务板里把一条任务标成“已取消”或“失败”,主要是更新业务记录,不保证对应的命令或 Agent Run 已经停止。要真正终止执行,请打开“任务管理器”,找到对应条目后使用“停止”;程序不响应时再考虑“强制停止”。强制停止可能丢失尚未写入文件的内容。 + +## 下达任务时说清楚什么 + +一份好用的长任务说明,至少要让智能体知道下面这些信息。 + +| 你需要说明 | 示例 | +|---|---| +| 最终要拿到什么 | “输出一份分析报告和整理后的数据表” | +| 输入材料在哪里 | “原始文件在 `input/`,不要修改它们” | +| 怎样算完成 | “300 份文件都有结果,失败项单独列出原因” | +| 阶段成果放哪里 | “中间结果放到 `work/`,最终结果放到 `output/`” | +| 哪些动作要先问你 | “不要发邮件,不要发布,不要覆盖原文件” | + +例如: + +```text +分析 input 目录里的全部合同,最后给我一份风险汇总表和一份 Markdown 报告。 +原文件不要修改。先抽取文本,再逐份检查,最后统一汇总。 +每完成一批就保存结果并更新进度;单份合同失败不要停掉全部任务,把失败原因记下来继续处理。 +``` + +如果任务范围还不清楚,先让智能体只写计划: + +```text +先不要执行。先统计文件数量、估算步骤和风险,把计划给我看。 +``` + +关于计划文件和修改方式,参见[计划确认](./02-plan-confirmation.md)。 + +## 需要运行很久的命令 + +构建、测试、训练、数据转换和求解器任务经常会长时间占用终端。不要让智能体一直停在前台等一条命令返回,可以这样说: + +```text +这个命令可能运行很久,请作为受管后台任务启动。 +启动后告诉我任务名称、输出保存在哪里,以及我之后怎样查看或停止它。 +不要给它设置很短的运行时限。 +``` + +后台运行不等于失去控制。任务开始后,你仍然可以在任务管理器或终端面板查看状态和输出,也可以让智能体停止它。 + +需要管理员权限的命令是例外。系统授权框必须有人在场确认,这类命令不能作为无人值守后台任务运行。让智能体优先寻找用户级安装或写入方式;确实需要管理员权限时,把那一步单独放到前台执行。 + +想停下来时,直接说: + +```text +停止刚才的后台任务,保留已经产生的输出和进度记录,不要删除中间成果。 +``` + +DesireCore 会停止受管进程并保留已有输出,但某些外部服务已经接收的请求未必能够撤回。例如云端训练已经提交后,本地停止等待不一定会取消云端作业。遇到这类任务,最好在开始前让智能体说明取消方式。 + +## 怎么看它做到哪了 + +长任务不需要守着聊天窗口刷新。你可以随时问: + +```text +现在做到哪一步了? +上一阶段的成果保存在哪里? +还有哪些没有完成,是否遇到阻塞? +``` + +判断任务是否真的在推进,优先看这些证据: + +- 计划或任务清单里的状态有没有更新; +- 工作目录里是否出现了阶段成果; +- 后台命令是否仍在运行,输出有没有新的进展; +- 智能体是否明确记录了失败项,而不是只报一个模糊的百分比。 + +如果你只是想知道业务阶段,先看全局任务板。需要确认实际 Run 或后台命令还在不在、运行了多久、有没有输出,打开“任务管理器”。任务管理器还会显示 CPU、内存、进程数、输出速率和最近输出;指标显示“未采样”时,不要把它误解成 0。 + +任务管理器中的“停止”会先请求任务自己收尾;只有它没有响应时才使用“强制停止”。后台命令可以进一步打开日志或工作目录,Agent Run 可以跳转到对应运行记录,交互终端可以回到终端面板。 + +聊天内的进度展示和暂停、继续操作见[执行监控](./03-execution-monitoring.md)。 + +## 中断后怎样继续 + +重新打开对话后,不要只说“继续”。给智能体一个明确的恢复顺序: + +```text +继续上次的任务。先读取原计划、进度记录和现有成果,确认最后一个已经完成的阶段。 +从下一阶段继续,不要覆盖已经验收的文件,也不要重复已经完成的外部操作。 +如果现有记录不足以安全继续,先告诉我缺什么,不要猜。 +``` + +如果中断前有一条命令仍在后台运行,先让智能体确认它是否还活着。不要直接再启动一份相同任务,否则可能出现两份训练、两次发布或重复写入。 + +如果全局任务板仍显示“进行中”,但任务管理器里已经没有对应 Run 或后台命令,先让智能体核对已有成果和终止原因,再更新任务板。反过来,任务板已经标为失败但任务管理器里进程仍在跑时,应先决定是否保留它,再从任务管理器停止;不要仅靠改任务状态来处理进程。 + +对话本身变得很长时,可以使用 [`/compact`](../02-conversations/09-context-control.md) 整理上下文。聊天记录仍然保留,智能体后续主要读取任务摘要和最近进展。 + +## DesireCore 会自动做什么 + +对于仍有正常活动的任务,DesireCore 不会因为运行超过五分钟就主动结束它。系统会区分“任务做得久”和“连接长时间完全没有反应”: + +- 正常产生进度、流式内容或状态消息时,任务可以继续运行; +- 连接长时间没有任何活动时,系统会按网络或服务异常处理; +- 受管后台命令默认不会继承前台命令的短等待时间; +- 后台命令运行时,DesireCore 会在有界的安全时间内尽量阻止电脑因闲置自动休眠。 + +这里的“阻止闲置休眠”不是万能的。合上笔记本、手动点休眠、关机或电量过低,仍可能让任务中断。准备无人看守地运行几个小时时,建议接通电源、保持 DesireCore 运行,并确认系统不会因为合盖或公司设备策略强制休眠。 + +DesireCore 也不知道你的业务里“完成一阶段”究竟意味着什么。比如合同处理要不要逐份落表、训练任务应该保留哪些模型文件、发布失败后哪些步骤不能重跑,这些需要你在任务要求里说清楚,或者提前[教给智能体](../03-teaching/03-teach-rules.md)。 + +## 长任务、定时任务还是心跳 + +这三个概念很容易混在一起: + +| 你的需求 | 适合的方式 | +|---|---| +| 现在开始,做完为止,可能要几个小时 | 长耗时任务 | +| 明天 9 点开始、每天检查一次,或每周五执行 | [定时任务](../08-automation/03-scheduled-tasks.md) | +| 让智能体定期自检当前事项,有值得跟进的内容再主动联系你 | [心跳监控](../08-automation/01-heartbeat.md) | + +“现在分析这 300 份合同”是长耗时任务。“每周五分析本周新增合同”和“每天检查是否出现高风险合同,有才告诉我”都是定时任务,因为它们指定了明确的执行周期;“有才告诉我”只是本次执行的通知条件。心跳适合让智能体自行判断当前事项是否有值得主动跟进的变化,而不是代替已经明确到每天、每周或具体时刻的调度。 + +## 常见问题 + +### 超过五分钟会自动停止吗? + +不会。五分钟不再是任务的总运行上限。任务仍可能因为网络断开、服务失去响应、电脑休眠、权限不足或你主动停止而结束。 + +### 我可以关掉 DesireCore 吗? + +不建议。部分受管命令具备恢复能力,但一次完整任务还可能包含模型调用、文件处理和等待确认。看到明确的完成通知前,最好让 DesireCore 保持运行。 + +### 智能体说“已完成”,但我看不到结果文件怎么办? + +让它给出具体路径并检查文件: + +```text +请列出已经完成的阶段、每个阶段的成果文件路径,并逐个确认文件可以读取。 +没有落盘的内容不要算作已完成。 +``` + +### 失败后一定能自动恢复吗? + +不一定。DesireCore 能保留任务、输出和运行状态,但能否安全接着做,取决于智能体有没有把业务进度写清楚。涉及付款、发布、发信、提交训练作业等外部操作时,恢复前必须先核对是否已经执行,不能只看本地记录就重来。 diff --git a/i18n/en/docusaurus-plugin-content-docs/current/02-user-guide/04-delegation/03-execution-monitoring.md b/i18n/en/docusaurus-plugin-content-docs/current/02-user-guide/04-delegation/03-execution-monitoring.md index 7cec0be..5ba359a 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/02-user-guide/04-delegation/03-execution-monitoring.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/02-user-guide/04-delegation/03-execution-monitoring.md @@ -246,3 +246,7 @@ A synchronous delegation has a separate wait limit. If the parent receives a “ :::info Next Step During execution, certain high-risk operations will trigger "Human Gate" confirmation. Go to [Human Gate Confirmation Mechanism](./04-human-gate.md) for details. ::: + +:::tip Will the task run for half an hour or longer? +See [Long-running tasks](./07-long-running-tasks.md) for instructions on saving stage progress, running commands in the background, and resuming from existing results after an interruption. +::: diff --git a/i18n/en/docusaurus-plugin-content-docs/current/02-user-guide/04-delegation/07-long-running-tasks.md b/i18n/en/docusaurus-plugin-content-docs/current/02-user-guide/04-delegation/07-long-running-tasks.md new file mode 100644 index 0000000..b086046 --- /dev/null +++ b/i18n/en/docusaurus-plugin-content-docs/current/02-user-guide/04-delegation/07-long-running-tasks.md @@ -0,0 +1,214 @@ +--- +title: Long-running tasks +description: Use the Global Task Board to track builds, training runs, batch processing, and long research tasks, then resume from saved progress after an interruption. +keywords: [long-running tasks, background tasks, global task board, task manager, staged progress, resume, builds, training, batch processing] +sidebar_position: 7 +last-reviewed: 2026-08-26 +--- + +# Long-running tasks + +Some work simply takes time: analyzing hundreds of files, running a full build, training a model, solving a large schedule, or researching a subject across many sources. It may take half an hour or several hours. + +For this kind of task, do not focus on choosing a very large wait time. Ask the agent to leave its progress in the working directory. If the network drops, the app restarts, or a step fails, the agent can inspect what already exists and continue from there. + +## A prompt you can copy + +Add this after your task description: + +```text +This is a long-running task. Before starting, write a plan and divide the work into stages that can be checked independently. +After each stage, save the results in the working directory and update the progress record. Do not report a stage as complete only in chat. +If the task is interrupted or restarted, inspect the existing files first and continue after the last completed stage. Do not redo finished work. +Ask me before overwriting files, sending anything externally, publishing, or spending money. +``` + +This tells the agent how to divide the work, where progress must be recorded, how to resume, and which actions still need your approval. + +If you use this pattern often, you can [teach it to the agent](../03-teaching/03-teach-rules.md) once instead of repeating it in every task. + +## Put each stage on the Global Task Board + +The task list inside a chat is useful while you remain in that conversation. When work spans several hours, multiple conversations, or several agents, put the stages on the Global Task Board. You can then see who owns each stage, what is blocked, and which results need your approval without searching old chats. + +Add this to your request: + +```text +Create or reuse a Global Task Board for this work. +Create one task for every stage that can be reviewed independently. Record the assignee, completion criteria, result files, and prerequisites. +Move a task to “In progress” when work starts. If work cannot continue, mark it “Blocked” and record the reason. When a stage is ready, move it to “Needs review” and wait for my acceptance before marking it “Completed.” +Update the board whenever the state changes instead of filling it in after all work is done. +``` + +A batch contract review might use these tasks: + +| Task | Assignee | Completion criteria | Prerequisite | +|---|---|---|---| +| Count and validate input files | Contract agent | File count and failure list are saved | None | +| Extract contract text in batches | Document agent | Every contract has readable text or a failure reason | Input validation | +| Review risk clauses | Contract agent | Per-contract findings are saved in a table | Text extraction | +| Prepare and submit the report | Contract agent | Report and summary table are ready for review | Risk review | + +Do not represent “analyze 300 contracts” as one enormous In progress task. Two hours later, that card still cannot tell you whether extraction is slow, review is blocked, or the report is already waiting for approval. + +### Reading the Global Task Board + +Open Global Task Board from the left navigation and switch to Task overview: + +- All Tasks searches across tasks, scopes, states, priorities, and participating agents. +- By owner groups work by agent or team and shows totals, active work, blockers, review, and overdue counts. +- Needs attention collects work that has not started, is blocked, awaits agent review, awaits your acceptance, failed automatic handling, or needs manual takeover. + +After selecting a board, open Current board. Use the board or list view and filter by state, assignee, priority, or due date. To understand why work cannot continue, inspect prerequisites, comments, and linked records rather than relying on a percentage. + +For long-running work, check In progress, Blocked, and Needs review most often: + +- In progress should have an assignee and a recent update. +- Blocked should explain what is missing and who can resolve it. +- Needs review means a stage result is ready for you. It does not mean the entire project is complete. + +### Global Task Board and Task Manager serve different purposes + +| Surface | What it records | Use it for | +|---|---|---| +| Chat task list | Key work items in the current conversation | A quick progress view while chatting | +| Global Task Board | Business stages, owners, blockers, and review across conversations and agents | “How far has the work progressed?” | +| Task Manager | Live Agent Runs, background commands, terminals, and internal hosts | “What is still running?” | +| Terminal panel | Complete output and interaction for one terminal | Detailed logs or further input | + +Changing a Global Task Board item to Canceled or Failed updates the business record. It does not guarantee that the related command or Agent Run has stopped. To terminate execution, open Task Manager and use Stop on the corresponding entry. Use Force stop only when the program does not respond; unsaved output may be lost. + +## What to include in the task + +Give the agent enough information to answer these questions: + +| What to specify | Example | +|---|---| +| What should the final result be? | “Produce an analysis report and a cleaned data table.” | +| Where are the inputs? | “The original files are in `input/`. Do not modify them.” | +| What counts as complete? | “All 300 files have a result, and failed files have a recorded reason.” | +| Where should intermediate results go? | “Put working files in `work/` and final results in `output/`.” | +| Which actions require approval? | “Do not send email, publish, or overwrite original files.” | + +For example: + +```text +Analyze every contract in the input directory. Produce a risk summary table and a Markdown report. +Do not modify the original files. Extract the text first, review the contracts one by one, and then create the summary. +Save results and update progress after each batch. If one contract fails, record the reason and continue with the others. +``` + +If the scope is still unclear, ask the agent to stop after planning: + +```text +Do not execute yet. Count the files, estimate the steps and risks, and show me the plan first. +``` + +See [Plan confirmation](./02-plan-confirmation.md) for where plans are stored and how to revise them. + +## Commands that take a long time + +Builds, tests, training jobs, data conversion, and solver runs can occupy a terminal for a long time. Instead of leaving the agent blocked in a short foreground wait, say: + +```text +This command may take a long time. Start it as a managed background task. +Tell me the task name, where its output is saved, and how I can inspect or stop it later. +Do not give it a short execution limit. +``` + +Background execution does not mean giving up control. You can inspect the task and its output in Task Manager or the terminal panel, and you can ask the agent to stop it. + +Commands that require administrator privileges are an exception. Someone must be present to approve the operating-system prompt, so these commands cannot run as unattended managed background tasks. Ask the agent to prefer a user-level install or write location, and run the small privileged step in the foreground only when it is unavoidable. + +To stop safely, say: + +```text +Stop the background task, but keep its output and progress records. Do not delete intermediate results. +``` + +DesireCore keeps the output produced by a managed process. It cannot always undo work already accepted by an external service. For example, stopping a local wait may not cancel a cloud training job that has already been submitted. Ask the agent to explain the cancellation method before starting such work. + +## Checking progress + +You do not need to keep refreshing the chat. Ask: + +```text +Which stage are you working on now? +Where is the result from the previous stage? +What remains, and is anything blocked? +``` + +Look for concrete evidence: + +- the plan or task list has been updated; +- stage results exist in the working directory; +- the background process is still running and producing useful status; +- failed items have recorded reasons instead of being hidden behind a vague percentage. + +See [Execution monitoring](./03-execution-monitoring.md) for the progress panel and pause/resume controls. + +For business-stage progress, check Global Task Board first. To confirm whether an Agent Run or background command is still alive, how long it has run, or whether it is producing output, open Task Manager. Task Manager also shows CPU, memory, process count, output rate, and recent output. “Not sampled” does not mean zero. + +Stop asks the task to finish cleanly. Use Force stop only if it does not respond. A background command can open its log or working folder, an Agent Run can open its run record, and an interactive terminal can return to the terminal panel. + +## Resuming after an interruption + +After reopening a conversation, give the agent a recovery order instead of saying only “continue”: + +```text +Continue the previous task. Read the plan, progress record, and existing results first, then identify the last completed stage. +Continue with the next stage. Do not overwrite accepted files or repeat completed external actions. +If the records are not sufficient to continue safely, tell me what is missing instead of guessing. +``` + +If a command may still be running in the background, ask the agent to check it before starting another copy. Duplicate training, publishing, or writes can be much worse than waiting a moment to verify. + +If the Global Task Board still says In progress but Task Manager no longer has the related Run or command, ask the agent to inspect saved results and the termination reason before updating the board. If the board says Failed while a process is still running, decide whether to keep that process and stop it from Task Manager if necessary. Changing the task state alone is not process control. + +When the conversation itself becomes long, use [`/compact`](../02-conversations/09-context-control.md). The visible history remains available while the agent works from a task summary and the most recent progress. + +## What DesireCore handles automatically + +DesireCore does not stop a healthy task merely because it has run for more than five minutes. It distinguishes slow work from a connection that has stopped responding: + +- normal progress, streamed content, or status messages allow work to continue; +- a connection with no activity for a long time is handled as a network or service failure; +- managed background commands do not inherit the short default wait used for foreground commands; +- while a background command is running, DesireCore tries to prevent idle system sleep for a bounded safety period. + +This does not override closing the laptop lid, manual sleep, shutdown, low battery, or device-management policy. For unattended work that will run for hours, connect the computer to power, leave DesireCore running, and make sure the machine will not be forced to sleep. + +DesireCore also cannot infer what “one completed stage” means in your business. You still need to define which files must be saved, which model artifacts matter, or which external actions must not be repeated. Put those rules in the task or [teach them to the agent](../03-teaching/03-teach-rules.md). + +## Long task, scheduled task, or heartbeat? + +| Your need | Use | +|---|---| +| Start now and work until completion, even if it takes hours | A long-running task | +| Start tomorrow at 9:00, check every day, or run every Friday | A [scheduled task](../08-automation/03-scheduled-tasks.md) | +| Let the agent periodically review the current matter and contact you only when follow-up is worthwhile | A [heartbeat](../08-automation/01-heartbeat.md) | + +“Analyze these 300 contracts now” is a long-running task. “Analyze the contracts added this week every Friday” and “Check every day for new high-risk contracts and notify me only when one appears” are scheduled tasks because both specify when to run. “Notify me only when one appears” is an output condition, not a different scheduling mechanism. Use a heartbeat when the agent should decide whether the current matter needs proactive follow-up, without a business instruction tied to a specific daily, weekly, or clock-based schedule. + +## Common questions + +### Will the task stop after five minutes? + +No. Five minutes is not the total task limit. A task can still end because of a network failure, an unresponsive service, system sleep, missing permission, or your own stop request. + +### Can I quit DesireCore? + +It is safer to leave it running. Some managed commands can be recovered, but a complete task may also include model calls, file operations, and approval requests. + +### The agent says it is done, but I cannot find the result + +Ask for paths and verify the files: + +```text +List the completed stages and the result file for each one. Verify that every file can be opened. +Do not count anything that exists only in chat as completed work. +``` + +### Will every failed task resume automatically? + +No. DesireCore can preserve task state and output, but safe resumption depends on the business progress recorded by the agent. Payments, releases, messages, and submitted cloud jobs must be checked before retrying.