Commit Graph

125 Commits

Author SHA1 Message Date
Ollie Agent 4b6562b6f2 add t/route: unified dispatch with tier selection
- route --tier=worker (default): cheap model for scoped subtasks
- route --tier=expert: strong model for complex reasoning
- Orchestrator now uses route instead of cascade
- Unified prompt and callback contract for both tiers
- cascade/escalate remain available for other agents
2026-05-20 09:26:05 +02:00
Ollie Agent d28d6af23c agents: slim down configs, remove unused tools
- Remove task tools from default/coding agent prompts (planning is coding-only)
- Remove MCP server config from coding agent
- Remove env and grep tools from orchestrator allowlist
- Delete unused tool scripts: env, grep, task_add, task_check, task_clear
- Strip default agent to minimal prompt set
2026-05-20 09:14:46 +02:00
Ollie Agent 4471d25344 orchestrator/worker: relax to goal-oriented delegation
- Orchestrator: describe what, not how. Workers reason about implementation.
- cascade prompt: allow workers to read code and make decisions within scope.
- Worker identity: 'reason and complete' replaces 'execute exactly'.
- Removes over-specification pressure from orchestrator.
2026-05-20 09:10:06 +02:00
Ollie Agent 7418114e44 add escalate tools 2026-05-19 15:27:22 +02:00
Levi Neely 137d2c0e84 tools: add structured STATUS prefix signals for smaller model clarity
Addresses the loop/no-op problem where small models (e.g. devstral-small)
fail to interpret ambiguous prose output as terminal control signals.

Changes:
- file_write: prefix STATUS=done/no_change/error with STATE_CHANGED and RETRYABLE
- file_edit: same prefix scheme; also RETRYABLE=true for ambiguous match errors
- file_read: prefix STATUS=ok/empty/not_found/error to distinguish data absence from failure
- file_glob: prefix STATUS=ok/no_matches/error with MATCH_COUNT
- file_grep: prefix STATUS=ok/no_matches/error with MATCH_COUNT
- task_add: emit STATUS=ok ADDED=N TOTAL_TASKS=M
- task_check: emit STATUS=done TASK_COMPLETE=true/false REMAINING=N
- task_clear: emit STATUS=ok CLEARED=N REMAINING=N TASK_COMPLETE=true/false
- cascade: rewrite worker termination block as numbered mandatory rules;
  add explicit STATUS: error branch; clarify stop-after-write requirement
2026-05-19 10:15:08 +00:00
Ollie Agent 39b54f1571 improve system prompt 2026-05-18 22:39:07 +02:00
Ollie Agent eba9120d61 update agent/cascade models 2026-05-18 11:56:40 +02:00
Levi Neely 426e3a423b env/grep tools, orchestrator file_edit 2026-05-17 16:46:30 +02:00
Levi Neely 2b30e3cc3e add orchestrator/worker agents; update cascade defaults to deepseek v4 2026-05-17 15:04:06 +02:00
Levi Neely 6884e69995 subagent_generate: validate constraints is an array 2026-05-17 14:02:58 +02:00
Levi Neely a5efaa623f subagent_generate: rewrite as standalone Python; fix spawn header
- Eliminates inline Python-in-shell; same logic, directly inspectable.
- Fix stale Output comment in subagent_spawn header.
2026-05-17 14:01:57 +02:00
Levi Neely 36eeb38a06 subagent_spawn: only cleanup jit-* configs; fix Returns doc 2026-05-17 13:59:59 +02:00
Levi Neely 2703ea5d3f subagent_spawn: auto-cleanup JIT config; report resolved backend/model
- Remove JIT agent config from a/ after session creation (server has
  already loaded it), eliminating identity debris accumulation.
- Read actual backend/model from session cfg instead of echoing
  CLI-level defaults.
- Remove manual cleanup instruction from prompt (now automatic).
2026-05-17 13:58:41 +02:00
Levi Neely 65f7bc3bd9 subagent_spawn: exponential backoff, structured output; fix stale docs
- Replace 5s/50ms poll with exponential backoff (~25s total)
- Output structured KV (session, path, backend, model) like cascade
- subagent_generate: remove stale result_path from header, document arg input
- Soften 'always use pipeline' to guidance matching actual behavior
2026-05-17 13:57:10 +02:00
Levi Neely bf91cab41c subagent_generate: accept JSON as arg; remove all escaping from prompt examples 2026-05-17 13:54:38 +02:00
Levi Neely 2516209acc subagent_spawn: read agent name from stdin when piped; fix prompt to use pipe
subagent_spawn now reads the agent name from stdin (first line) when
-agent flag is not provided and stdin is not a tty. This enables clean
pipe composition: echo JSON | subagent_generate | subagent_spawn.
2026-05-17 13:49:55 +02:00
Levi Neely e4608b09aa cascade: fail fast without OLLIE_SESSION_ID; structured output record 2026-05-17 13:28:21 +02:00
Levi Neely c1857f8545 cascade: include hostname in session ID to avoid collisions on shared mounts 2026-05-17 13:20:24 +02:00
Levi Neely 033df45ef9 cascade: exponential backoff for session readiness poll 2026-05-17 13:19:50 +02:00
Levi Neely b4be3a01d9 add cascade tool and script-driven orchestrator
tools/cascade: fire-and-forget delegation to cheap model; worker
reports back to parent prompt when done. Parallelizable.

scripts/u/cascade: script-driven hub-and-spoke orchestrator for
terminal use — planner decomposes, workers execute in parallel,
planner synthesizes.
2026-05-17 13:16:18 +02:00
Levi Neely 7ae8b69ec9 tools: per-tool semantic truncation (file_grep 50, lsp_references 50, memory_recall 10/50, file_read 500) 2026-05-17 12:51:49 +02:00
Levi Neely c2f8eb29a6 tools: annotate file_read and memory_recall as cold-tier 2026-05-17 10:59:18 +02:00
Levi Neely 3eb5152ded remove result_path — redundant with parent_session_id header 2026-05-17 10:34:35 +02:00
Levi Neely 9c0d22960b subagent_spawn: inject parent plan as context header 2026-05-17 10:26:57 +02:00
Levi Neely 5f0e25bd1d subagent_generate: structured identity envelope (role, roster, protocol, constraints) 2026-05-17 10:26:22 +02:00
Levi Neely 94d8923167 prompt: tighten narration rules; file_grep: default to content mode 2026-05-16 07:37:18 +02:00
Levi Neely 9fabcb3851 tools/lsp: add parallel annotation to read-only lsp tools 2026-05-11 13:23:37 +02:00
Levi Neely e1e5538a42 tools: remove hardcoded fallback paths in memory_remember, task_check 2026-05-11 13:20:26 +02:00
Levi Neely f320979142 tools/lsp: fix _lib import path, add lsp_completion
All lsp_* scripts used OLLIE_TOOLS_PATH for sys.path which points to
the physical backing store where _lib does not exist. Changed to use
$OLLIE/t (the FUSE mount) where _lib actually lives.

Also added lsp_completion script and textDocument/completion support
in the LSP bridge.
2026-05-11 13:19:02 +02:00
Levi Neely d7a6d7b8c3 file_read: remove max size limit, use islice for streaming reads
The 8MB size check caused models to fall back to cat which reads the
entire file without truncation. Now uses itertools.islice to read only
the requested segment without loading the whole file into memory.

Also: sandbox config additions (pcfs, ~/img).
2026-05-08 11:28:43 +02:00
Levi Neely 33323b275e subagent_generate: fix JIT agent system prompt
Use $OLLIE/x/prime SYSTEM_PROMPT command instead of bare token.
Wrap custom prompt in echo command since all prompt array entries
are now shell commands.
2026-05-04 11:33:36 +02:00
Levi Neely 2bbaecb531 JIT subagent generation via subagent_generate | xargs subagent_spawn
- rename agent_generate to subagent_generate
- subagent_generate reads JSON from stdin, copies default.json as base,
  replaces prompt with SYSTEM_PROMPT + identity text
- update tools-subagent.md to enforce composition pattern
- remove unused agent configs and prompts (devops, qa, reviewer,
  sysarchitect, writer)
- update agents/README.md
- update core submodule (remove stale-read pruning)
2026-05-02 13:50:52 +02:00
Levi Neely af6547eb3a subagent_spawn: use /bin/date to avoid plan9 date 2026-05-02 10:50:14 +02:00
Levi Neely bee78e308c tools: add agent_generate for JIT agent creation
New tool that generates a temporary agent config from a base agent
with custom identity text. Returns a unique agent name (jit-<hex>)
for use with subagent_spawn. Single file in a/, no p/ file needed.
2026-05-02 10:29:06 +02:00
Levi Neely 29ea11be22 lsp tool 2026-04-30 14:39:13 +02:00
Levi Neely 3fec18b780 tools: add LSP bridge and tool scripts
Adds a thin LSP bridge daemon (tools/_lib/lsp/) that manages LSP server
processes on demand, with adapters for gopls, clangd, and intelephense.

Tool scripts:
- lsp_definition: go to definition
- lsp_references: find all references
- lsp_hover: type/doc info
- lsp_rename: rename symbol (applies edits directly)
- lsp_symbols: document/workspace symbols
- lsp_diagnostics: errors and warnings
2026-04-30 11:12:31 +02:00
Levi Neely 03f661c0a6 subagent_spawn: use __ separator for parent prefix 2026-04-29 18:21:52 +02:00
Levi Neely 993097ef6f subagent: fire-and-forget spawn, auto-inject parent/session IDs, env file
subagent_spawn rewritten: creates session, submits prompt, returns
immediately. Auto-prefixes session name with parent ID for uniqueness.
Injects [parent_session_id] and [session_id] headers into every prompt.

New read-only env file in session namespace exposes OLLIE_ vars.
TUI background-tails chat file for async output.
Updated SYSTEM_PROMPT.md and tools-subagent.md.
2026-04-26 22:19:06 +02:00
Levi Neely b33a411427 subagent: add -name flag, document roster convention
subagent_spawn now passes -name through to b, letting the parent assign
predictable session IDs. Updated coordination docs: parent passes full
peer roster in seeding prompts, names prefixed with parent session ID
for global uniqueness. Noted silent failure on duplicate names.
2026-04-26 20:34:27 +02:00
Levi Neely 2f9e392320 restore reasoning_think tool and prompt
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 19:07:13 +02:00
Levi Neely e4c76603ba remove reasoning_think tool and prompt
Backend now streams native thinking tokens via StreamEvent.Reasoning.
The no-op scratchpad tool is redundant.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 19:04:03 +02:00
Levi Neely d9e9ca1b52 file tools: simplify to read/edit/write without sentinel machinery
system prompt: require task list for multi-step work
agents: remove preTurn hook; rely on agentSpawn prime + system prompt
backend: require OLLIE_BACKEND/OLLIE_MODEL env vars

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 18:29:18 +02:00
Levi Neely b5a0765fc1 tools/agents: skip blank task_add args; remind task_check when plan has open tasks
preTurn now has two branches: no plan → remind task_add; open tasks → remind
task_check. Blank/whitespace-only arguments to task_add are silently skipped.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 13:26:03 +02:00
Levi Neely dcf7d4010f tools/prompts: fix task_add printf bug; point agents at t/idx for tool discovery
printf format string starting with '-' was treated as a flag; use '--' to
terminate option parsing. Agents reading individual tool scripts to understand
them should use $OLLIE/t/idx instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 13:10:36 +02:00
Levi Neely b7f6b08e6a task: session plan checklist; replace todo.sh fallback
- tools/task_add, task_check, task_clear: manage s/{sid}/plan markdown checklist
- prompts/tools-task.md: agent command reference, injected at spawn via prime tools-task
- agents: add 'prime tools-task' to agentSpawn in all configs
- scripts/x/task: show_plan() on 'task list'; drop todo.sh fallback (wrong tool)
- prompts/tools-todosh.md: removed (no longer needed)
- prompts/tools-subagent.md: add coordination model documentation
- core: update submodule ref (s/{sid}/plan 9p endpoint)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 12:30:14 +02:00
Levi Neely 1a01002f7b planning: observe step, task dispatcher, tool parallel annotations, graceful degradation
- agents: agentSpawn uses 'task prime', postTurn uses 'task list' (observe step)
- scripts/x/task: dispatcher routes to bd (beads) or todo.sh based on availability
- prompts/tools-todosh.md: prime context for todo.sh fallback
- tools: add '# ollie:parallel read' annotation to file_read, file_glob, file_grep,
  file_grep, memory_recall, reasoning_think, denote_view
- core: update submodule ref

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 09:00:54 +02:00
Levi Neely 7b8d665457 fix subagent_spawn, sort sessions, update prompts
- subagent_spawn: use s/bfg instead of deprecated b/q
- SYSTEM_PROMPT: fix stale /b/ reference to /s/
- core: sort session index by ID
- webui: gitignore .kiro/
2026-04-24 21:44:57 +02:00
Levi Neely f918955951 file_read: return (binary file) when null bytes detected 2026-04-23 11:35:12 +02:00
Levi Neely ec385d0d6e planning: remove plan_* tools and prompt entirely
The markdown planning mechanism created competing signals against beads.
Removing it eliminates the conflict. Planning goes through beads (bd)
or whatever external mechanism is appropriate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 11:36:56 +02:00
Levi Neely 2d3d17237b tools,scripts: use -e not -d for .git boundary check
Submodules have .git as a file, not a directory. -d was stopping the
walk immediately in submodule directories.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 11:20:34 +02:00
Levi Neely a960566ec9 tools,scripts: bound .beads walk-up at .git boundary
Walk up from CWD only while .git exists at each level. Stops at the
first directory without .git, preventing false positives outside the repo.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 11:18:08 +02:00
Levi Neely dc5356b242 tools: walk up from CWD to find .beads for monorepo support
The .beads check now traverses parent directories so plan_* enforcement
works from any subdirectory of the repo, not just the root.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 11:14:36 +02:00
Levi Neely c7fb791434 tools: fix .beads check to use -d (directory, not file)
bd init creates .beads/ as a directory; -f was silently failing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 11:13:37 +02:00
Levi Neely 89f340eca9 tools: change OLLIE_BEADS_ENABLE default to 1 (opt-out instead of opt-in)
plan_* now blocks by default when bd and .beads are present.
Set OLLIE_BEADS_ENABLE=0 to use the markdown-based plan_* scripts instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 11:11:26 +02:00
Levi Neely 4f3e04de13 tools: add .beads project file as third guard for plan_* enforcement
All three conditions must hold to block plan_* in favor of bd:
  OLLIE_BEADS_ENABLE=1, bd on PATH, and .beads exists in CWD.
This makes enforcement purely opt-in per project.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 10:47:22 +02:00
Levi Neely 663e7f305a tools: enforce beads for planning when OLLIE_BEADS_ENABLE=1 and bd is present
If both conditions hold, plan_* scripts exit 2 with an error directing
the model to use bd instead. When either condition is false (beads not
configured or bd not installed), the scripts run normally as a fallback.

Document OLLIE_BEADS_ENABLE in README and doc/help.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 10:43:32 +02:00
Levi Neely 0abcb6367c beads integration (wip); fix plan_create printf; bump core
- agents/test-bd.json: test agent with bd prime agentSpawn hook
- prompts/06_tool-plan.md: prefer beads when context injected at session start
- tools/plan_create: fix printf treating '- [ ]' format as option flag
- submodules: bump core

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 07:24:51 +02:00
Levi Neely 8a82d0966b elevation: add x/elevate plugin; update mkfile and docs
Replace tools/elevate_superpowers with scripts/x/elevate — a single
self-contained plugin that bootstraps into a superpowers session and
runs the IPC. mkfile installs it to ~/.config/ollie/scripts/x/.
Update 08_tool-elevate.md to remove backend-specific language.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 20:50:37 +02:00
Levi Neely 4202505704 elevation: add elevate_superpowers tool; remove frontend env injection from s/sh and submodules
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 20:07:10 +02:00
Levi Neely c5d87567ce prompts: restructure system prompt; replace task tools with plan_* lifecycle
- Rename and reorder prompt files: skills bumped to 02, tool prompts
  prefixed tool-*, execute_code prompt removed (content absorbed into schema)
- Rewrite all tool prompts with explicit Trigger/Calling convention/Returns/Constraints structure
- Trim 03_reasoning.md to essentials; add "returns nothing" clarification
- Restructure task planning: replace task_plan/task_complete with explicit
  plan_create/plan_start/plan_check/plan_finish lifecycle tools
  - plan_finish enforces hard constraint: fails if any - [ ] tasks remain
- Remove no-shell-redirect rule from 00_base (consolidated into 03_tool-files)
- Add t/idx discovery and parallel schema advice to execute_code JSON schema
- Remove dead execute_pipe/execute_tool trustedTools references from agent configs
- Make keyword greps case-insensitive (-i flag)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 14:48:10 +02:00
Levi Neely c3d8879702 tools: rewrite subagent_spawn as thin wrapper around b/q -parallel
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 13:40:55 +02:00
Levi Neely 792ea4663f subagents: add subagent_spawn tool and system prompt fragment
tools/subagent_spawn: fork-join over b/; spawns N parallel subagents
with a shared prompt, polls status concurrently, joins results in
submission order.

prompts/08_subagents.md: core system prompt fragment — when to spawn,
flags, output format, design rules. Always in context, not a skill.
2026-04-16 20:14:57 +02:00
Levi Neely 510ddbd904 new tools 2026-04-15 15:52:02 +02:00
Levi Neely 8ca905799b fix: error handling, sandbox env, file tool enforcement
- tools/file_*: hard-fail when OLLIE_SESSION_ID is unset; surface errors
  on all failure paths including dir checks, marker cleanup, and I/O
- tools/file_read: treat nonexistent path as new file (emit "(new file)",
  write empty marker) so file_write can create new files
- tools/file_write: colorize new-file lines with + (U+FF0B)
- tools/file_glob, file_grep, memory_*, task_*: consistent error handling
  and output to stdout so the model sees all failures
- tui/diffcolor.go: match +/− (U+FF0B/U+2212) lookalikes emitted by
  file_edit/file_write; fix +++ / --- header pattern
- prompts: prohibit execute_code for file creation/modification;
  enforce execute_tool with file_write/file_edit instead
- core submodule: surface isError from MCP responses; inject
  OLLIE_SESSION_ID into execute server at session creation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 22:52:10 +02:00
Levi Neely 1b9c7af9c9 tools: clear usage messages on all tools when called with no/bad args
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 18:21:35 +02:00
Levi Neely 7999bd34a7 Revert "tools: fix file_edit and file_write to write directly, not via temp+rename"
This reverts commit ce1688efb8.
2026-04-14 18:14:16 +02:00
Levi Neely ce1688efb8 tools: fix file_edit and file_write to write directly, not via temp+rename
The temp file + os.replace() (rename) pattern fails on FUSE-mounted paths
(e.g. $OLLIE/sk/, $OLLIE/pl/) because the 9P server doesn't implement Twstat.
Write directly to file_path instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 18:12:59 +02:00
Levi Neely de00ac1fcc rename OLLIE_9MOUNT → OLLIE throughout; update submodules
Tools, sandbox configs, docs, and skills all updated. $OLLIE is now
the canonical ollie root — cd $OLLIE goes directly to the FUSE mount.
Core now always injects $OLLIE into the execute env at session start.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 17:39:48 +02:00
Levi Neely 7d43a53e48 add memory_remember and memory_recall tools; fix sandbox for pyenv
memory_remember: saves a denote-formatted flat file to $OLLIE_9MOUNT/m
memory_recall: searches memories by keyword/tag/title via grep

Both write/read through the 9P FUSE mount. Removed os.makedirs calls
that failed with ERANGE on the 9P-backed /m directory.

sandbox/restricted.yaml: add {HOME}/.pyenv, .rbenv, .nvm to rox so
python3 and other version-managed interpreters can execute.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 17:29:35 +02:00
Levi Neely 542c5ab96d update submodules and tools: fix memory write path
- sandbox: ~/mnt/ollie added as RWX, OLLIE_9MOUNT passed through
- 9p server: create memory dir on startup
- tools: memory_remember/recall use $OLLIE_9MOUNT/m

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 16:11:57 +02:00
Levi Neely 53371da547 tools: add memory_remember and memory_recall
Flat-file denote-formatted memories in OLLIE_MEMORY_PATH.
memory_remember: YYYYMMddTHHmmss__{slug}--{tags}.md with required
denote frontmatter (title, date, tags, identifier, signature).
memory_recall: grep-backed search across filenames and bodies.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 15:41:43 +02:00
Levi Neely 4d9550e9cf tools: add file_* and reasoning_think scripts; rename task tools
Add shell script implementations of file_read, file_write, file_edit,
file_grep, file_glob, reasoning_think. Rename task_plan.sh/task_complete.py
to task_plan/task_complete (shebang detection makes extensions unnecessary).

Update submodules: core, 9p, skills.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 15:26:42 +02:00
Levi Neely 450a5ba7b9 tools: remove tools.sh — discovery now handled by prompt injection
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 13:02:27 +02:00
Levi Neely 995d72a776 tools: add tools.sh discovery script; update prompt for schema-less tools
tools.sh reads # description/# Args headers from all scripts and prints
a summary — one call replaces the schema injection built-in tools get
for free. Prompt now directs the model to run it before using unfamiliar
tools.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 10:58:03 +02:00
Levi Neely e4aaa25991 tools: add task_plan and task_complete as shell/python scripts
Replaces the removed built-in task server. Plans are written to
$OLLIE_9MOUNT/pl/ (persistent, shared across sessions). Scripts live
in the tools directory and are invoked via execute_tool.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 09:00:57 +02:00