Introduction¶
In a DSH environment, implementing periodic task scheduling usually requires large-model decision-making, which consumes Tokens and increases latency. The dsh-task-dispatch-table plugin separates scheduling logic from execution logic and provides a table-driven scheduling solution directly managed by the host process, without consuming large-model resources.
Plugin Overview¶
This is a DSH Host-layer plugin maintained by cq-guojia. It drives periodic workflows through a task definition table. When a task reaches its time window or satisfies its dependency conditions, it is dispatched as an independent DSH session for execution. The scheduling itself uses pure programmatic logic and does not involve large-model calls.
Core Features¶
Scheduling Logic¶
The scheduler runs at a fixed Tick interval. It checks the task definition table to determine whether a task is within its time window and whether its dependency conditions are met. A session is created only when a task actually needs to run.
Scheduling Modes¶
Three modes are supported:
1. One-time: Run once at a specified time.
2. Periodic: Run at fixed times daily, weekly, or monthly.
3. Interval: Run at intervals of N hours or N days.
Each mode supports an “allowed delay window”. If the host is busy or down, the task can be run as a catch-up within the window; if the window is exceeded, it is recorded as skipped.
Task Dependencies¶
Dependencies are declared by downstream tasks (similar to the needs model in Airflow). When a task is triggered, the plugin freezes the upstream instances and their outputs and passes them to the downstream session, ensuring that downstream data is consistent with the trigger moment.
Sessions and State¶
Each run generates an independent session with status, Token usage, artifacts, and event logs. After execution, the session is archived, allowing users to view logs, extract artifacts, or continue the conversation.
Task Management UI¶
Provides task lists, run records, logs, execution timeline, and calendar views, with bilingual display supported.
Installation and Activation¶
After installation, no additional configuration or local build is required; it can be run directly via npm. The installation command is as follows:
dsh plugin --profile web add dsh-task-dispatch-table
Usage Flow¶
1. Create a Task¶
Create a new task in the editor. Set the title, prompt, scheduling method (one-time, periodic, or interval), and attachments. Attachments support links or uploads (maximum 20MB per file).
2. Configure and Trigger¶
Configure plugin parameters through the settings panel (such as Tick interval and Run log retention). Click the “Run now” button on a task card to manually trigger execution.
3. Track Execution¶
Expand task details to view run history, logs, and archived sessions. Use the calendar and execution timeline to track the status of all tasks.
Configuration¶
Plugin configuration is stored in its own state database. The main parameters are as follows:
- Tick interval: Scheduler scan frequency, default 60 seconds.
- Run log retention: Retention period for run logs in days, default 30 days.
- Temp attachment retention: Retention period for temporary attachments in days, default 7 days.
- Default model: Uses the host default model when a task does not specify a model.
- Dispatch grace: Maximum waiting time for a dispatched session to appear, default 60 seconds.
- Run lease: Lease duration for silent sessions, default 1800 seconds.
- Observation window: Duration for monitoring sessions in unknown state, default 300 seconds.
Notes¶
- No build required: No local build is needed after installation; it can be run directly.
- Data persistence: Configuration is stored in the plugin’s own state database and will not be lost when host configuration is reset.
- Attachment limits: Maximum upload size is 20MB per file.
- Language switching: The UI supports bilingual display and switches automatically with the DSH interface language setting.
- License: MIT License.
Conclusion¶
By decoupling the scheduling layer from the execution layer, this plugin provides DSH with periodic task management capabilities that require zero large-model intervention. It is suitable for scenarios requiring strict dependency management, execution status tracking, and periodic workflow orchestration.