进阶 zcode.z.ai 2026-11-25 14:51:22 · 0 阅读

第30章 Scheduled Tasks

Core FeaturesScheduled Tasks Scheduled tasks let ZCode Agent run instructions at specified times and save the results in a session. Use them for recurring work such as code change summaries, release briefs, and documentation checks. For work that should run when spare capacity is available, without a fixed schedule, see Idle-time Tasks. Click Automations in the left sidebar to open the management page. It lists tasks across local projects; each task retains its own workspace, schedule, and instructions. The Workflows tab at the top of the page manages saved workflows; see Dynamic Workflows. When no tasks exist, the page provides creation controls and templates. Once tasks exist, use the task-type controls and All / In progress / Completed / Failed filters to find tasks and review their schedule, status, and cumulative run count. Idle-time task controls depend on account availability and existing tasks. 123 1Create a scheduled task2Status, schedule, and run count3Create from a template Create a Scheduled Task Create tasks using a form, a conversation, or a template. Tasks created in a conversation remain linked to that conversation. From the Form Click Create scheduled task and complete these fields: FieldDescriptionTask titleIdentifies the task in the list and run historyScheduleThe execution time and repeat frequency; see Schedule RulesInstructionsThe prompt sent to the Agent on each run. Specify the goal, scope, and expected outputProject / permission / model / reasoning levelThe toolbar below the instructions; see Task Configuration 123 1Set the schedule2Choose workspace, mode, and model3Create the task From a Chat Session Open the menu beside the create button and select Create in chat. Edit the prefilled example to describe your requirements, for example: Every weekday at 9am, summarize this project's code changes and open follow-ups. The scheduled task is bound to that conversation. Later runs send their results to the same conversation instead of creating a new one. Once created, a task card appears in the conversation; Go to scheduled tasks opens its details. Archiving that conversation automatically pauses its scheduled tasks; to keep one running, choose Continue for the task on the Automations page. From a Template Templates are grouped by task type. Selecting a scheduled-task template prefills the title, instructions, and schedule for review before saving. Common examples include: Morning dev brief: summarize recent progress and follow-ups. Risk scan: review recent code changes for potential issues. Release brief: organize the week's changes into release notes. Documentation sync check: compare documentation with the implementation. Templates may change with service configuration. Check the instructions and execution mode before saving. If you only need a report, explicitly request read-only analysis. Schedule Rules Choose Every hour / Every day / Every weekday / Every week / Every month / Custom. Select Custom for more detailed repeat rules: SettingOptionsRepeat unitMinute, hour, day, week, month, or yearIntervalAn integer from 1 to 200, such as every 2 hours or every 3 daysSpecific timingWeekdays, month dates, months, and the hour and minuteMonthly ruleBy date, such as the 15th, or by weekday, such as the first MondayExample: repeat every Monday, Wednesday and Friday, with no end date. After confirmation, the schedule appears as a summary and can be reopened for editing. Minute intervals start when the task is created or its schedule is changed. For example, an every-10-minutes task created at 11:46 is first scheduled for 11:56, not 11:50. End Dates and Run Limits For recurring tasks, select Ends in the custom repeat dialog and choose an end date. The cutoff is the end of that day in the local timezone. The task then becomes Completed. To run once, limit the number of scheduled runs, or use a relative delay, describe it in chat—for example, “Check the build result once in 30 minutes” or “Write a release brief every Friday for four runs.” The form has no maximum-run-count field. You can also ask the Agent to update an existing task's instructions or schedule. If a conversation-created schedule only appears as Custom and cannot be edited directly, remove that schedule in the editor, set a new one, and save. This does not delete the task itself. All times use your computer's local timezone. Task cards display the next run time, using relative times within a month and dates for more distant runs. Task Configuration Use the toolbar below the instructions to configure execution: Project: select an available local project open in the current window, or Work outside a project. The execution location cannot be changed after creation. Permission: choose the same execution modes available in conversations. Choosing Full access asks you to confirm the risks in a dialog first. Model: the form reads the selected project's model configuration. Confirm the displayed model or choose another available model; the task's selection is recorded when saved. Reasoning level: choose from the levels supported by the selected model. Resolve unavailable model configuration before saving. Choose an execution mode appropriate to the task. For reports, ask for a read-only review in the instructions and specify the scope and output requirements. Manage and Run Tasks Open the ⋯ menu at the top right of a task card to run, pause, edit, or delete it. After pausing a task, Pause changes to Continue. 1234 1Run now2Pause; Continue when paused3Edit the task4Delete the task Run Now Select Run now from the task menu to trigger one execution without changing its repeat rule, next scheduled time, or enabled state. Successful dispatch increases the cumulative run count and creates a history record, but does not consume a limited scheduled-run allowance. If a run is still active, triggering the task again does not queue a duplicate. The interface reports that the previous run is still in progress. Pause, Edit, and Delete Pause and resume: pausing retains the task and stops future scheduled triggers. Resuming continues its schedule. Edit: open the task card or its edit action to change the title, schedule, instructions, and execution options. Leaving with unsaved changes prompts for confirmation. Restart: failed tasks provide this action to schedule another run and reset the cumulative count and retry state. Completed tasks do not provide Restart or Pause / Continue controls. Delete: deleting the task definition prevents new scheduled triggers. Run History Switch between Settings / History in the task details. History records individual runs as running, succeeded, failed, stopped, or skipped when a trigger window was missed. The table shows trigger time, source, status, and duration. Source distinguishes scheduled and manual runs. Use the row menu to open the corresponding conversation or delete the record. Deleting a history record does not delete the task definition or free a task slot. 123 1Open History2Review the run outcome3Open the session or delete the record Task Status Task states are Active, Paused, Completed, and Failure. Active means the schedule is enabled; it does not mean the Agent is executing at that moment. Each run's outcome is recorded in run history and does not change the task state. ActiveSchedule on; triggers on timeRun historyMon 09:00ScheduledSucceededWed 09:00ScheduledSkippedWed 10:12ManualSucceededFri 09:00ScheduledFailureEach run is recorded in history only; the task status stays the samePausedContinue resumes the schedule⋯ menu → PauseCompletedEnd date passed, or all runs usedFailureRestartA one-time or limited task failed to start 5 times in a rowIf a run can't startAuto retryafter 30 s, 1 min, 2 min, 4 minRecurring taskswait for the next scheduled time Paused: choose Pause from the ⋯ menu. Choose Continue to resume the schedule. Completed: a task with an end date becomes Completed after that date passes; a one-time or limited task becomes Completed once its runs are used up. Failure: if a task can't start when it is due (for example, its project is unavailable), ZCode retries automatically after 30 seconds, 1 minute, 2 minutes, and 4 minutes. A recurring task that still can't start skips that run and waits for its next scheduled time. A one-time or limited task changes to Failure; choose Restart from the menu to schedule it again. Errors during a run: if the task starts but ZCode Agent hits an error while working, run history shows Failure for that run. The task stays Active and triggers as usual next time. Requirements and Limits Runtime Environment Tasks execute locally. Keep the computer awake and ZCode running. When the app resumes, a scheduled trigger missed by five minutes or more is marked Skipped. Recurring tasks proceed to the next scheduled occurrence; one-time tasks are not replayed. The keep-awake switch is shared with Settings → General → Keep computer running. It prevents idle sleep but does not prevent manual sleep or sleep caused by closing the lid. Task Limit Up to 20 scheduled task definitions can be saved. The limit applies across local projects and includes paused, completed, and failed tasks. Delete an unneeded definition to free a slot. Idle-time tasks have a separate limit. If the Agent reaches the scheduled-task limit, it reports the error without deleting existing tasks automatically. Execution Location New tasks can target an available local project open in the current window or run without a project. Remote workspaces cannot be selected for new tasks; existing remote tasks remain viewable and manageable. Automations are not shown in the mobile remote-control interface. Next Steps Idle-time TasksQueue work for periods when spare capacity is available.Goal ModeSet a verifiable goal for the Agent to work toward.Task & File ManagementOrganize tasks and browse workspace files.

评论 (0)