ServicesTask Service
Agent Task Mode
kind=agent behavior, use cases, and output expectations
Agent Task Mode
kind=agent executes task body through the agent. It is single-round by default; only review: true enables the executor plus user-simulator multi-round review flow.
What It Fits
- tasks that require reasoning and iteration
- research / analysis / summarization
- human-readable reusable deliverables
What It Is Not
- not a normal chat turn
- not a database-backed task queue
- not a mode that requires external channel delivery by default
Use cases
- tasks requiring reasoning and iteration
- research / analysis / summarization
- human-readable deliverables
Execution characteristics
- single-round execution by default
- automatic multi-round review only when
review: true(default max: 3) - live progress events visible in Console UI
- final output written to
output.md, with summary inresult.md - executor query / reply also written into run-directory
messages.jsonlfor debugging
Current Execution Logic
- Load
task.mdand parse frontmatter plus body. - Create a new run directory:
./.downcity/task/<taskId>/<timestamp>/. - Write
input.mdandrun-progress.json. - Create a task-specific runtime instead of reusing normal chat history.
- Let the executor agent produce a result.
- If
review: true, let the user-simulator agent evaluate whether the result satisfies the task goal. - If
review: trueand the result is not good enough, feed the previous output plus simulator feedback back into the executor, up to 3 rounds. - If review is disabled, finish after the first valid output.
- Write
output.md,result.md,dialogue.*,run.json, anderror.mdwhen needed.
Success Rules
- an
agenttask now only requires valid single-round output text by default - successful
chat_senddelivery is no longer required by default - if
review: true, the output also goes through simulator review and up to 3 rounds of revision - if the task body explicitly asks for external delivery, that requirement belongs to the task itself
Context Model
sessionIdis stored in task definition and decides which chat receives the task result- execution uses a separate task run context
- task execution therefore does not directly reuse normal chat message history
Diagram
Best practices
- write explicit goals, boundaries, and acceptance criteria
- keep review off by default; only set
review: truewhen you really need review-and-revise behavior - require auditable outputs when possible
- do not put raw shell scripts in agent tasks
Example
---
title: daily-market-research
description: daily market research summary
sessionId: research
when: 0 8 * * *
status: enabled
kind: agent
review: true
---
Generate today's market research summary including:
1. major events
2. key risks
3. next-step recommendations