diff --git a/prompts/tools-cascade.md b/prompts/tools-cascade.md deleted file mode 100644 index 79a57c5..0000000 --- a/prompts/tools-cascade.md +++ /dev/null @@ -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: [""]}] -call_tool: calls=[{tool: "cascade", args: ["", ""]}] -``` - -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=] -STATUS: done -SUMMARY: -``` - -**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 | diff --git a/prompts/tools-route.md b/prompts/tools-route.md deleted file mode 100644 index c0a0d69..0000000 --- a/prompts/tools-route.md +++ /dev/null @@ -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: [""]}] -call_tool: calls=[{tool: "route", args: ["", "--tier=worker"]}] -call_tool: calls=[{tool: "route", args: ["", "--tier=expert"]}] -call_tool: calls=[{tool: "route", args: ["", "--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=] -STATUS: done -SUMMARY: -``` - -**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. diff --git a/tools/cascade b/tools/cascade deleted file mode 100755 index 499c945..0000000 --- a/tools/cascade +++ /dev/null @@ -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: [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: - - On failure: - [from=${id}] - STATUS: error - REASON: - -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" diff --git a/tools/escalate b/tools/escalate deleted file mode 100755 index c2b1145..0000000 --- a/tools/escalate +++ /dev/null @@ -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: [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: - - On failure, use: - [from=${id}] - STATUS: error - REASON: - -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"