Task Runtime Plugin
The Task Runtime plugin runs scheduled agent runs — tasks created with the Task Tools, operator-declared tasks from the tasks: block, and every Goals worker. It has no agent-facing tools. It owns:
- the run history (
scheduled_runs, intask_tools.sqlite3in the data directory — the file kept its historical name); - the
agent_task_runjob handler, which turns a fired task into a fresh conversation; - the maintenance sweep: on server start and then on a timer it fails runs stuck in
running, ends runs that waited on an approval for too long, and purges old run history and trigger events.
task_tools and goals both depend on it. Disabling task_tools removes only the scheduling tools; goal workers and declared tasks keep running as long as this plugin is loaded. A config whose plugins: list names task_tools or goals but not this plugin gets it added with its defaults (a log line says so).
Configuration
plugins:
- module: codumentor.plugins.task_runtime
class: TaskRuntimePlugin
priority: 5
args:
enabled: true
run_history_retention_days: 365
| Parameter | Type | Default | Description |
|---|---|---|---|
enabled | bool | true | Enable or disable the plugin. Disabled, nothing runs scheduled tasks or goal workers. |
run_history_retention_days | int | 365 | How long to keep finished run history — and the per-run conversations, which are soft-deleted first — before a maintenance sweep purges them. 0 or negative keeps history forever. |
retention_sweep_interval_seconds | float | 86400 | How often the maintenance sweep runs (retention purge plus stale-run cleanup). A restart also sweeps immediately. |
stale_run_threshold_seconds | float | 3600 | A run that has been running with no progress longer than this is treated as stuck and marked failed. |
parked_run_ttl_seconds | float | 604800 | How long a run whose turn is waiting on an approval may wait. Past it, the maintenance sweep ends the run as failed (stale) and drops its token ledger. A waiting run is never treated as stuck by the threshold above. 0 disables. |
These four maintenance settings are also accepted under task_tools' args:, where older configs have them; the loader applies them here and logs a warning asking you to move them.
Notes
- The trigger event ledger's retention (
tasks.event_retention_days) rides the same sweep. - A run that waits on an approval keeps its budget when resumed; this bookkeeping is in memory, so after a restart such a run ends
failed(stale).