add orchestrator/worker agents; update cascade defaults to deepseek v4

This commit is contained in:
Levi Neely 2026-05-17 15:04:06 +02:00
parent 58912fc30c
commit 2b30e3cc3e
6 changed files with 103 additions and 7 deletions

24
agents/orchestrator.json Normal file
View File

@ -0,0 +1,24 @@
{
"prompt": [
"$OLLIE/x/prime SYSTEM_PROMPT",
"$OLLIE/x/prime agent-orchestrator",
"$OLLIE/x/prime tools-file",
"$OLLIE/x/prime tools-cascade"
],
"model": "deepseek/deepseek-v4-pro",
"maxSteps": 30,
"temperature": 0.3,
"maxTokens": 8192,
"allowExecutors": ["call_tool", "pipe"],
"allowTools": [
"file_read",
"file_glob",
"file_grep",
"cascade"
],
"hooks": {
"turnError": [
"$OLLIE/x/freeloader $OLLIE_SESSION_ID"
]
}
}

20
agents/worker.json Normal file
View File

@ -0,0 +1,20 @@
{
"prompt": [
"$OLLIE/x/prime SYSTEM_PROMPT",
"$OLLIE/x/prime tools-file",
"$OLLIE/x/prime tools-lsp"
],
"model": "deepseek/deepseek-v4-flash",
"maxSteps": 50,
"temperature": 0.5,
"maxTokens": 16384,
"allowExecutors": ["execute_code", "call_tool", "pipe"],
"trustedTools": [
"execute_code"
],
"hooks": {
"turnError": [
"$OLLIE/x/freeloader $OLLIE_SESSION_ID"
]
}
}

View File

@ -49,3 +49,11 @@
# u/complete: backend and model for acme code completion (required by u/complete)
#OLLIE_COMPLETE_BACKEND=ollama
#OLLIE_COMPLETE_MODEL=qwen3:latest
# cascade: planner (orchestrator) model for u/cascade script
#OLLIE_CASCADE_PLAN_BACKEND=openrouter
#OLLIE_CASCADE_PLAN_MODEL=deepseek/deepseek-v4-pro
# cascade: worker model for spawned agents
#OLLIE_CASCADE_BACKEND=openrouter
#OLLIE_CASCADE_MODEL=deepseek/deepseek-v4-flash

View File

@ -0,0 +1,43 @@
You are an orchestrator agent. You plan and delegate — you never implement.
# Role
- Decompose tasks into self-contained subtasks.
- Delegate each subtask to a worker via `cascade`.
- Read files for context. Never write or edit files yourself.
- Synthesize worker results into a coherent response.
# Constraints
- **No code generation.** You do not write, edit, or produce code. Workers do that.
- **No execute_code.** You cannot run shell commands or scripts directly.
- **Read-only filesystem.** You may use `file_read`, `file_glob`, and `file_grep` to gather context. That is all.
- **Delegation via cascade only.** Use `cascade` to dispatch work to workers.
# Delegation protocol
Delegate with `call_tool`:
```
call_tool: calls=[{tool: "cascade", args: ["<fully self-contained instruction>"]}]
```
Parallel fan-out:
```
call_tool: calls=[
{tool: "cascade", args: ["<task A>"]},
{tool: "cascade", args: ["<task B>"]}
]
```
# Writing good instructions
Each cascade instruction must be **completely self-contained**. The worker has no context beyond what you provide. Include:
- Absolute file paths
- Exact expected behavior or output format
- Relevant code snippets or constraints the worker needs
# After delegation
- Do not wait or poll. End your turn after dispatching.
- Workers report back asynchronously via `[from=...]` messages.
- When results arrive, verify they satisfy the original task, then synthesize a final answer.

View File

@ -21,10 +21,10 @@ set -euo pipefail
OLLIE="${OLLIE:-$HOME/mnt/ollie}"
B="$OLLIE/s/b"
PB="${OLLIE_CASCADE_PLAN_BACKEND:-anthropic}"
PM="${OLLIE_CASCADE_PLAN_MODEL:-claude-sonnet-4-20250514}"
WB="${OLLIE_CASCADE_BACKEND:-ollama}"
WM="${OLLIE_CASCADE_MODEL:-qwen2.5-coder:14b}"
PB="${OLLIE_CASCADE_PLAN_BACKEND:-openrouter}"
PM="${OLLIE_CASCADE_PLAN_MODEL:-deepseek/deepseek-v4-pro}"
WB="${OLLIE_CASCADE_BACKEND:-openrouter}"
WM="${OLLIE_CASCADE_MODEL:-deepseek/deepseek-v4-flash}"
die() { printf 'cascade: %s\n' "$*" >&2; exit 1; }

View File

@ -5,8 +5,8 @@
set -euo pipefail
OLLIE="${OLLIE:-$HOME/mnt/ollie}"
BACKEND="${OLLIE_CASCADE_BACKEND:-ollama}"
MODEL="${OLLIE_CASCADE_MODEL:-qwen2.5-coder:14b}"
BACKEND="${OLLIE_CASCADE_BACKEND:-openrouter}"
MODEL="${OLLIE_CASCADE_MODEL:-deepseek/deepseek-v4-flash}"
die() { printf 'cascade: %s\n' "$*" >&2; exit 1; }
@ -21,7 +21,8 @@ id="${2:-cascade-$(date +%s%N)-$$-$(hostname -s)}"
kv="name=${id}
cwd=$(pwd)
backend=${BACKEND}
model=${MODEL}"
model=${MODEL}
agent=worker"
printf '%s\n' "$kv" > "$OLLIE/s/new" || die "failed to create session"
B="$OLLIE/s/$id"