Repository navigation
02 Execution
Source: docs/design/02-execution.md
- Reply turns talk and decide; tasks execute
- Turns never block on tasks
- Every finished task must be settled so a turn can consume the result (“must settle” invariant)
- Soft isolation + leases, not git worktrees for task isolation
| Reply turn | Task | |
|---|---|---|
loop_type |
turn |
task |
| Latency | Seconds | Minutes–hours |
| Tools | Read-only core + routing + async managed actions | Full surface |
| Engine | Always built-in pi | Built-in or external ACP agent |
| Parallelism | Serial per (Bot, conversation) | Parallel within caps |
Deep dive: 30-Supervisor-and-Tasks.
Turns use enumerated tools: start_task, inject_task, cancel_task, list_tasks, plus capability search/call (40-Capability-Mounting). Task cards leave a visible routing trail.
Serialisation is on turns, not tasks. Incoming events queue in a mailbox until the next turn. Write mutual exclusion uses leases on workdir/workspace keys (one writer task per workdir). Scheduler enforces per-conversation and global task caps.
States include running → completed / failed / interrupted / cancelled, etc. Settlement writes a durable notify entry (main.db) then task terminal state (runs.db); wakeup is host-deterministic. Reaper repairs incomplete settlement after crashes.
Wake examples: task result, failure, interrupt; user cancel from task card wakes; Bot’s own cancel_task / delete-driven cancel / empty result may not.
Each loop produces a run with steps (assistant text, tool calls, progress). Continuation between tasks uses explicit continues_task_id replay (automatic loop continuation removed for turns).
Default ephemeral: mark interrupted, prompt on restart, no auto-resume (D49). Durable journal (24-Durable-Execution) not implemented. External side-effect ledger tool_effects (D78) is implemented — retry after interrupt may require “I verified” when prior effects completed/unknown.
Final assistant reply auto-posts; mid-turn send_message; skip_reply for silence; structured @ only. Interim narrations auto-post with caps (D54). Status line at stream end (D55).
Missing config → structured setup failure → inline card → retry (18-Inline-Setup, 38-Conversational-Settings).
Includes turn, task, subagent, reflection/wiki maintenance, widget_authoring, etc. Context injection differs by type (conversation info, memories, schedules, tasks, capabilities, private timeline).
No @: previous speaker continue-check → lead gateway → guaranteed outcome. Collaboration episodes + circuit breakers replace token-budgeted chains. See 41-Project-Team.
Inside a task: sync / parallel fan-out / collect results — not group members, no re-delegate. See 23-MCP-and-SubAgent.
delegate_to_bot A→B with intents; not SubAgent. See 27-Butler-and-Delegation.
Schedules, offer_schedule nudges (D80), web watches (D79) wake turns with guardrails (daily caps, quiet hours). Watches use hidden browser pages and content-hash edge triggers.
Supported for user/Bot messages within product rules (D6).
KepCup
Core
- 01-Conversation
- 02-Execution
- 03-Bot
- 04-Memory
- 05-Wiki-and-Skills
- 30-Supervisor-and-Tasks
- 40-Capability-Mounting
- 43-Task-Loop-Harness
Runtime
- 06-Isolation-and-Storage
- 07-Local-Runtime
- 08-Workdir
- 09-Tech-Stack
- 10-Sandbox
- 11-Storage
- 13-Permissions
- 24-Durable-Execution
Product
- 12-UI-Layout
- 33-Narrow-Layout
- 39-Workbench
- 41-Project-Team
- 42-Task-Run-View
- 45-Bot-File-Cards
- 47-File-WebApp-Viewer
Capabilities
- 14-Models-and-Browser
- 15-Interactive-Execution
- 16-Capability-Models
- 17-MinerU-Document-Parsing
- 18-Inline-Setup
- 19-Work-Path-and-Group-Setup
- 20-Conversation-Media
- 21-Web-Search
- 22-File-Skill-Routing
- 23-MCP-and-SubAgent
- 25-Capability-Tools
- 26-Voice-Input
- 31-Sensors
- 32-Bot-Widgets
- 35-Mail-Channel
- 36-Wiki-Multimodal-Ingest
- 38-Conversational-Settings
Team & agents
- 27-Butler-and-Delegation
- 28-External-Agents-ACP
- 37-Bot-Asset-Handover
- 41-InkCop-Local-Collab
- 48-Bot-Template-Export
Cloud & remote