remove tier routing: drop route/cascade/escalate tools and prompts
This commit is contained in:
parent
be2f3b3487
commit
e021724c52
|
|
@ -1,44 +0,0 @@
|
|||
# cascade
|
||||
|
||||
Delegate subtasks to a cheaper model. Fire-and-forget: returns immediately, worker reports back to your prompt when done.
|
||||
|
||||
**Trigger condition**: a subtask that can be described in a short instruction — the worker can read code, reason about implementation, and make decisions within the scope you define. Examples: implement a function, refactor a module, investigate a bug, extract and summarize information, apply an edit.
|
||||
|
||||
**Do NOT cascade when**: the task requires cross-cutting judgment that depends on context only you have, or coordination across multiple subtasks.
|
||||
|
||||
**Calling convention**:
|
||||
```
|
||||
call_tool: calls=[{tool: "cascade", args: ["<instruction>"]}]
|
||||
call_tool: calls=[{tool: "cascade", args: ["<instruction>", "<id>"]}]
|
||||
```
|
||||
|
||||
Parallel — consecutive calls fan out:
|
||||
```
|
||||
call_tool: calls=[
|
||||
{tool: "cascade", args: ["Add input validation to handleRequest in /src/server.go"]},
|
||||
{tool: "cascade", args: ["Write unit tests for ParseConfig in /src/config.go"]}
|
||||
]
|
||||
```
|
||||
|
||||
**Returns**: `session`, `backend`, `model` as KV lines.
|
||||
|
||||
**Worker callback**: arrives as your next queued turn via `PeerSubmit`:
|
||||
```
|
||||
[from=<session-id>]
|
||||
STATUS: done
|
||||
SUMMARY: <result>
|
||||
```
|
||||
|
||||
**Constraints**:
|
||||
- Instructions must be self-contained — include file paths and the goal, but you don't need to specify *how*. The worker reads code and reasons about implementation.
|
||||
- Never wait for results. Continue work or end your turn.
|
||||
- Results arrive asynchronously — only use cascade for work whose result you don't need in the current turn.
|
||||
- One task per call.
|
||||
|
||||
## cascade vs subagent_spawn
|
||||
|
||||
| | cascade | subagent_spawn |
|
||||
|---|---|---|
|
||||
| Model | Always cheap (configured globally) | Any model |
|
||||
| Identity | Fixed worker | JIT-generated |
|
||||
| Use case | Scoped subtasks | Specialized reasoning or custom identity |
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
# route
|
||||
|
||||
Route a subtask to an appropriate model tier. Fire-and-forget: returns immediately, agent reports back to your prompt when done.
|
||||
|
||||
**Trigger condition**: delegating a subtask. Choose the tier based on complexity:
|
||||
- `worker` (default) — scoped tasks: implement a function, apply an edit, investigate a file, extract information.
|
||||
- `expert` — tasks requiring deep reasoning, architectural judgment, or multi-file analysis with ambiguity.
|
||||
|
||||
Available backends for routing are listed in `$OLLIE_ENABLED_BACKENDS` (comma-separated).
|
||||
|
||||
**Calling convention**:
|
||||
```
|
||||
call_tool: calls=[{tool: "route", args: ["<instruction>"]}]
|
||||
call_tool: calls=[{tool: "route", args: ["<instruction>", "--tier=worker"]}]
|
||||
call_tool: calls=[{tool: "route", args: ["<instruction>", "--tier=expert"]}]
|
||||
call_tool: calls=[{tool: "route", args: ["<instruction>", "--tier=expert", "--backend=anthropic"]}]
|
||||
```
|
||||
|
||||
Parallel fan-out:
|
||||
```
|
||||
call_tool: calls=[
|
||||
{tool: "route", args: ["Add input validation to handleRequest in /src/server.go"]},
|
||||
{tool: "route", args: ["Redesign the caching layer in /src/cache/ to support TTL", "--tier=expert"]}
|
||||
]
|
||||
```
|
||||
|
||||
**Returns**: `session`, `backend`, `model`, `tier` as KV lines.
|
||||
|
||||
**Callback**: arrives as your next queued turn via `PeerSubmit`:
|
||||
```
|
||||
[from=<session-id>]
|
||||
STATUS: done
|
||||
SUMMARY: <result>
|
||||
```
|
||||
|
||||
**Constraints**:
|
||||
- Instructions must be self-contained — include file paths and the goal. The agent reads code and reasons about implementation.
|
||||
- Never wait for results. Continue work or end your turn.
|
||||
- One task per call.
|
||||
- Default to `worker`. Use `expert` only when the task genuinely needs stronger reasoning.
|
||||
- `--backend` overrides the default (parent's backend). Use when a specific backend is better suited.
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
# ollie:parallel read
|
||||
# description: Delegate a mechanical subtask to a cheaper/weaker model. Returns immediately; the worker reports back to your prompt when done. Use for tasks requiring no judgment — edits, lookups, transforms, formatting.
|
||||
# Args: <instruction> [id]
|
||||
set -euo pipefail
|
||||
|
||||
SERVICE="org.ollie.SessionManager"
|
||||
OBJ="/org/ollie/SessionManager"
|
||||
IFACE="org.ollie.SessionManager"
|
||||
|
||||
BACKEND="${OLLIE_CASCADE_BACKEND:-openrouter}"
|
||||
MODEL="${OLLIE_CASCADE_MODEL:-mistralai/devstral-small}"
|
||||
|
||||
die() { printf 'cascade: %s\n' "$*" >&2; exit 1; }
|
||||
|
||||
dbus_call() {
|
||||
dbus-send --session --dest=$SERVICE --type=method_call --print-reply \
|
||||
$OBJ "$IFACE.$1" "${@:2}" 2>/dev/null
|
||||
}
|
||||
|
||||
dbus_string() {
|
||||
dbus_call "$@" | awk -F'"' '/string "/{print $2; exit}'
|
||||
}
|
||||
|
||||
[ -z "${OLLIE_SESSION_ID:-}" ] && die "OLLIE_SESSION_ID not set (cascade must run inside a session)"
|
||||
|
||||
instruction="${1:-}"
|
||||
[ -z "$instruction" ] && die "instruction required"
|
||||
|
||||
id="${2:-cascade-$(date +%s%N)-$$-$(hostname -s)}"
|
||||
[ -n "$OLLIE_SESSION_ID" ] && id="${OLLIE_SESSION_ID}__${id}"
|
||||
|
||||
# Create session via D-Bus
|
||||
session_id=$(dbus_string CreateSession \
|
||||
string:"$(pwd)" string:"$BACKEND" string:"$MODEL" string:"worker")
|
||||
|
||||
[ -z "$session_id" ] && die "failed to create session"
|
||||
|
||||
# Rename to our chosen ID
|
||||
dbus_call RenameSession string:"$session_id" string:"$id" > /dev/null 2>&1
|
||||
|
||||
prompt="[parent_session_id=${OLLIE_SESSION_ID}]
|
||||
[session_id=${id}]
|
||||
|
||||
You are a worker agent. Read code, reason about implementation, and complete the task within its stated scope.
|
||||
|
||||
RULES:
|
||||
1. Complete the task using whatever tools are needed.
|
||||
2. Stay within scope — do not expand beyond what was asked.
|
||||
3. When finished, report your result back to the parent session using PeerSubmit.
|
||||
Format:
|
||||
|
||||
[from=${id}]
|
||||
STATUS: done
|
||||
SUMMARY: <what was accomplished>
|
||||
|
||||
On failure:
|
||||
[from=${id}]
|
||||
STATUS: error
|
||||
REASON: <why>
|
||||
|
||||
4. After reporting the result, STOP. One report, then stop.
|
||||
|
||||
TASK:
|
||||
${instruction}"
|
||||
|
||||
dbus_call Submit string:"$session_id" string:"$prompt" > /dev/null 2>&1 || die "failed to submit prompt"
|
||||
printf 'session=%s\nbackend=%s\nmodel=%s\n' "$id" "$BACKEND" "$MODEL"
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
# ollie:parallel read
|
||||
# description: Escalate a hard task to a stronger model. Returns immediately; the stronger model reports back to your prompt when done. Use when stuck — complex reasoning, debugging, architecture decisions.
|
||||
# Args: <instruction> [id]
|
||||
set -euo pipefail
|
||||
|
||||
SERVICE="org.ollie.SessionManager"
|
||||
OBJ="/org/ollie/SessionManager"
|
||||
IFACE="org.ollie.SessionManager"
|
||||
|
||||
BACKEND="${OLLIE_ESCALATE_BACKEND:-openrouter}"
|
||||
MODEL="${OLLIE_ESCALATE_MODEL:-anthropic/claude-sonnet-4-20250514}"
|
||||
|
||||
die() { printf 'escalate: %s\n' "$*" >&2; exit 1; }
|
||||
|
||||
dbus_call() {
|
||||
dbus-send --session --dest=$SERVICE --type=method_call --print-reply \
|
||||
$OBJ "$IFACE.$1" "${@:2}" 2>/dev/null
|
||||
}
|
||||
|
||||
dbus_string() {
|
||||
dbus_call "$@" | awk -F'"' '/string "/{print $2; exit}'
|
||||
}
|
||||
|
||||
[ -z "${OLLIE_SESSION_ID:-}" ] && die "OLLIE_SESSION_ID not set (escalate must run inside a session)"
|
||||
|
||||
instruction="${1:-}"
|
||||
[ -z "$instruction" ] && die "instruction required"
|
||||
|
||||
id="${2:-escalate-$(date +%s%N)-$$-$(hostname -s)}"
|
||||
[ -n "$OLLIE_SESSION_ID" ] && id="${OLLIE_SESSION_ID}__${id}"
|
||||
|
||||
# Create session via D-Bus
|
||||
session_id=$(dbus_string CreateSession \
|
||||
string:"$(pwd)" string:"$BACKEND" string:"$MODEL" string:"expert")
|
||||
|
||||
[ -z "$session_id" ] && die "failed to create session"
|
||||
|
||||
# Rename to our chosen ID
|
||||
dbus_call RenameSession string:"$session_id" string:"$id" > /dev/null 2>&1
|
||||
|
||||
prompt="[parent_session_id=${OLLIE_SESSION_ID}]
|
||||
[session_id=${id}]
|
||||
|
||||
You are an expert agent escalated to handle a task that a weaker model could not resolve. Apply rigorous reasoning to produce a correct, complete answer.
|
||||
|
||||
TERMINATION RULES (mandatory — follow exactly):
|
||||
1. Complete the task using whatever tools are needed.
|
||||
2. When finished (success or failure), report your result back to the parent session using PeerSubmit.
|
||||
Use this exact format:
|
||||
|
||||
[from=${id}]
|
||||
STATUS: done
|
||||
SUMMARY: <concise answer or confirmation>
|
||||
|
||||
On failure, use:
|
||||
[from=${id}]
|
||||
STATUS: error
|
||||
REASON: <why the task could not be completed>
|
||||
|
||||
3. After reporting the result, STOP. Do not call any more tools. Do not report again.
|
||||
4. Do not retry the report. One report, then stop.
|
||||
|
||||
TASK:
|
||||
${instruction}"
|
||||
|
||||
dbus_call Submit string:"$session_id" string:"$prompt" > /dev/null 2>&1 || die "failed to submit prompt"
|
||||
printf 'session=%s\nbackend=%s\nmodel=%s\n' "$id" "$BACKEND" "$MODEL"
|
||||
Reference in New Issue