Commit Graph

43 Commits

Author SHA1 Message Date
Ollie Agent f3933e21e7 backend: make reasoningEffort the primary knob with documented thresholds
reasoningEffort (low|medium|high) is now the single human-facing control
for model deliberation. Backends that speak a discrete level (OpenAI,
OpenRouter, Copilot, Gemini, Kiro) send it verbatim; Anthropic, which
needs a numeric budget, translates via documented thresholds
(low=4096, medium=8192, high=16384). thinkingBudget remains an advanced
explicit override that wins when set.

- Add EffortLow/Medium/High, threshold consts, ValidReasoningEffort,
  EffortThinkingBudget, and GenerationParams.ResolvedThinkingBudget.
- Anthropic: derive budget from effort, grow max_tokens above the budget
  (Anthropic requires budget < max_tokens), and force temperature=1 when
  thinking is enabled (both are Anthropic requirements).
- Validate reasoningEffort at config load so typos fail loudly instead
  of silently no-opping.
- theo: drop explicit thinkingBudget/inflated maxTokens; reasoningEffort
  high now implies the 16384 budget.
- Document thresholds and per-backend behavior in data/agents/README.md;
  fix stale autoLoad/maxSteps references.
- Add unit tests for the mapping and Anthropic thinking behavior.
2026-09-07 13:34:58 +02:00
Ollie Agent a9fe03eb71 agents: raise theo reasoning to high with thinking budget
Theo is a security auditor reasoning about injection, TOCTOU races,
crypto misuse, and confused-deputy problems — adversarial edge-case work
that needs deep deliberation, not the low effort it was set to. Bump to
reasoningEffort=high and add thinkingBudget=16384 so depth carries over
to Anthropic extended thinking. Raise maxTokens to 24576 so it stays
above the thinking budget (Anthropic requires budget < max_tokens).
2026-09-07 13:28:45 +02:00
Ollie Agent 6c7e5864c4 agents: set reasoningEffort per profile; rename thinkingBudget tag
Reasoning effort is part of an agent's behavior definition, so set it
on all 14 profiles keyed to role (planning/review high, general medium,
lightweight assist low). Also rename the ThinkingBudget json tag from
the confusing bare "reasoning" to "thinkingBudget", distinct from the
reasoningEffort string knob. No config migration needed — no profile or
backends.conf used the old "reasoning" key.
2026-09-07 13:27:33 +02:00
Ollie Agent 9395a0e07b config: rename agent autoLoad field to tools
The autoLoad name implied an automatic tool-loading path that no longer
exists; tools now come only from agent config plus the /tool_load ctl
command. Rename the AgentConfig.AutoLoad field (json autoLoad) to Tools
(json tools), rename LoadAutoLoadTools to LoadTools, and update all 14
agent JSON profiles and the tool-not-loaded error message.
2026-09-07 13:23:17 +02:00
Ollie Agent 86db9c797b agents: autoload all memory tools 2026-09-05 11:58:12 +02:00
Levi Neely 6b5d3fd0b6 agents: align autoLoad with agent roles
Each agent now has tools matching its purpose:

- Read-only agents (explorer, navigator, observer, theo, copilot):
  No shell, file_write, file_edit. Code analysis tools only.

- Workflow agents (author, reviewer, panelist, foreman):
  9p client for peer messaging and goalstatus.
  Analysis tools for verification.

- Orchestration agents (conductor):
  subagent_spawn, 9p client, analysis tools.
  No direct file editing (delegates to sub-agents).

- Full coding agents (default, driver):
  Complete toolset including shell, file ops, LSP, code intel.

- Support agents (librarian, taskmanager):
  Scoped to their domain (docs, task files).

Removed tools that violate agent constraints.
2026-08-21 10:14:42 +02:00
Ollie Agent 263ea51d29 restored autoload tools 2026-08-20 19:07:27 +02:00
Ollie Agent 4bf46ae85d Load hinted tools through the agent namespace 2026-08-20 18:29:10 +02:00
Levi Neely aad9c4f6e5 agents: move user-preferences to userPrompts
user-preferences.md is meant to be prepended to every user message,
not part of the system prompt. Moved from 'prompt' to 'userPrompts'
in: author, conductor, default, foreman, panelist, reviewer.

Other agents already had it in the correct location.
2026-08-20 11:48:10 +02:00
Levi Neely 59f729f591 Add review workflow: iterative author/reviewer refinement loop 2026-08-19 17:41:24 +02:00
Levi Neely 80a9f7ecc4 consensus workflow: foreman + panelist agents with peer messaging
New workflow that spawns N independent panelists (default 3) and a
foreman. Each panelist analyzes the goal from a different angle:
- correctness/completeness
- simplicity/maintainability
- edge cases/failure modes

Panelists report findings to foreman via peer/ links. The foreman
synthesizes agreement, resolves disagreements, and writes the verdict.

Files:
- data/workflows/consensus — orchestration script
- data/agents/foreman.json — low-temp synthesis profile
- data/agents/panelist.json — high-temp analysis profile
- data/prompts/agent-foreman.md — synthesis behavior
- data/prompts/agent-panelist.md — investigation behavior

Usage:
  printf 'name=review\ncwd=%s\nworkflow=consensus\n' $PWD | ollie-9p write session/new
  echo 'Review error handling in agent/loop.go' | ollie-9p write session/review/goal
2026-08-19 17:26:31 +02:00
Levi Neely b4baddd826 Memory tools: never expose raw memo commands to agents
- Add MEMO_TOOLS=1 env var to memo script; when set, all printed
  instructions reference native tool names instead of memo paths
- Set MEMO_TOOLS=1 in all memory tool .meta wrappers
- Add memory_nap tool for compressions
- Add memory_zoom tool for tree navigation
- Add part/T pagination args to memory_wake
- Update system prompt to use memory_zoom tool call
- Fix inject ctl: submit as user message when agent is idle
2026-08-19 10:13:02 +02:00
Ollie Agent 94b4c4be3f Integrate OptMem wake into agent memory prompting 2026-08-18 14:01:18 +02:00
Levi Neely d0ecc0c689 Update conductor agent: add code*/lsp* tools, fix prompt ordering
- Add code_outline, code_symbols, code_query, code_dependencies, codebase_overview
- Add lsp_definition, lsp_references, lsp_hover, lsp_symbols, lsp_diagnostics
- Reorder prompt: analyze goal first, then explore relevant codebase areas
2026-08-17 13:20:56 +02:00
Levi Neely 2cde59ac3b session-level goals: goal file + goalwait + conductor workflow
Write to session/{s}/goal to set a session-level objective.
A conductor agent is spawned automatically in the background,
decomposes the goal, spawns sub-agents, and reports completion.

- goal file: write sets goal + starts conductor; read returns status
- goalwait file: blocks until goal status changes (BlockOnce)
- Conductor writes status=complete/blocked back to goal when done
- Session.Goal() / SetGoal() / GoalSignal() on Session struct
2026-08-17 10:15:00 +02:00
Levi Neely 74ba5ae7ac remove maxSteps and ResetsCounter entirely
The step budget mechanism is gone. Agents run until they finish,
are interrupted by the user, or (for sub-agents) hit the timeout.

No replacement. The human is the kill switch.
2026-08-17 09:48:58 +02:00
Ollie Agent e854e91b7f replace just build orchestration with make 2026-08-17 00:01:27 +02:00
Ollie Agent f82b36ea80 Integrate OptMem memory backend 2026-08-16 11:10:50 +02:00
Ollie Agent 36649367eb remove obsolete process tools 2026-08-16 10:41:42 +02:00
Ollie Agent 50e465336e Add Tree-sitter code intelligence tools 2026-08-15 21:13:40 +02:00
Ollie Agent 159eb9c857 wip codebase cleanup, user-preferences updated 2026-08-15 12:05:22 +02:00
Ollie Agent 4142d39b2f fix: restore user-preferences.md to data/prompts, point userPrompts there 2026-08-15 11:58:06 +02:00
Ollie Agent 1b6bbd49dc refactor: move user-preferences.md to data/agents, use userPrompts config
- Move user-preferences.md from data/prompts/ to data/agents/.
- Remove it from prompt arrays in all agent JSON configs.
- Add userPrompts field referencing the file via $XDG_CONFIG_HOME path.
- Update justfile install target accordingly.
2026-08-15 11:56:12 +02:00
Ollie Agent 80d398dd88 doc: add userPrompts field to agent config README 2026-08-15 11:52:13 +02:00
Levi Neely db3c296b17 agents: add subagent_spawn to all shell-capable agent profiles 2026-08-14 15:02:07 +02:00
Levi Neely eca26bd6d4 default agent: add subagent_spawn to autoLoad 2026-08-14 14:56:51 +02:00
Levi Neely 961d5ca3bf remove subagent_generate: obsolete JIT profile mechanism 2026-08-14 14:56:05 +02:00
Levi Neely 16e54d1f03 fix: trailing comma in agent configs (invalid JSON from sed) 2026-08-13 21:49:58 +02:00
Levi Neely a1e78bca80 remove tool_load: use ctl directly
tool_load was a built-in intercept in the agent loop — the only
'tool' that didn't run in toolsrv. Removed entirely:
- Intercept in loop.go (25 lines)
- Script + .meta in data/tools/
- autoLoad references in agent configs

Loading tools is now exclusively via ctl (which already existed):
  echo 'tool_load X' | ollie-9p write .../ctl

System prompt updated to show the ctl pattern.
2026-08-13 21:44:46 +02:00
Levi Neely 81e78a952d add observer agent: read-only watcher with git-based feeder script
- observer.json: read-only tool set (file_read, file_grep, file_glob, reasoning_think)
- agent-observer.md: terse observation-only prompt
- observer-feed: polls git diff, feeds changes to agent prompt
- justfile: install new files
2026-08-13 14:28:20 +02:00
Ollie Agent 2d74ffb95e prompt audit: trim system prompt, kill dead code, improve maintainability
- System prompt: ~200 → ~80 lines (removed tool-first table, API docs,
  output protocol, dead 9P entries)
- Removed AllowTools entirely (field, RPC, configs)
- Removed PRIME_* env vars, replaced with typed struct fields
- Merged tool listing + docs into single renderTools()
- Killed BuildToolListing, changed OnToolsChanged to func() signal
- Typed Preamble.Section (compile-time safety)
- Added protocol docs on extractToolResult
- Added session/ package godoc
- Moved output protocol to per-agent prompts
- Rewrote data/agents/README.md
- Moved 7 reference docs from doc/resources/ to doc/
- Deleted PromptEnv() dead function
2026-08-09 14:13:52 +02:00
Ollie Agent c7aea0db59 rename elevate→bypass throughout
The sandbox escape mechanism is a bypass, not privilege elevation.
The old name caused the agent to confuse it with sudo.

- elevate/ → bypass/ (package, types, tests)
- elevate_notify.go → bypass_notify.go
- Namespace: /elevate → /bypass, session/*/elevate → session/*/bypass
- Tool arg: "elevated" → "bypass"
- Env: OLLIE_ELEVATE_SOCKET → OLLIE_BYPASS_SOCKET
- File: elevate-policy.yaml → bypass-policy.yaml
- All docs, prompts, and scripts updated
2026-08-09 02:22:39 +02:00
Levi Neely e84b4ffef7 feat: add resetsCounter tool property to reset step budget on active progress
Tools like file_write, file_edit, and shell now reset the agent's step
counter when called successfully. This allows the agent to continue
working without hitting the soft step-budget guardrail as long as it's
making active progress (writing files, running commands) rather than
looping on research/reading.

Changes:
- Add ResetsCounter bool to ToolInfo and MetaFile structs
- Parse resetsCounter from .meta JSON files
- Reset step counter in agent loop when ResetsCounter tool succeeds
- Add resetsCounter: true to file_write, file_edit, shell
- Reduce maxSteps from 50 to 25 (resetsCounter makes this safe)
2026-08-07 17:13:14 +02:00
Ollie Agent 06b287b8f2 remove hooks blocks and beads/freeloader refs from all agent JSON configs
- Remove "hooks" blocks from all 8 agent JSON files (copilot, default, driver, explorer, librarian, navigator, taskmanager, theo)
- Remove beads shell one-liner from prompt arrays in default.json and driver.json
- Hooks mechanism is dead code; these empty blocks are just noise
2026-08-07 07:15:04 +02:00
Ollie Agent d80a87eb86 clean up OLLIE_* env vars: replace with XDG conventions
- Remove all OLLIE_*_PATH vars (TOOLS_PATH, CFG_PATH, DATA_PATH, etc.)
  Use XDG_CONFIG_HOME/ollie/* and XDG_DATA_HOME/ollie/* instead
- Replace OLLIE_<TAG>_LOG per-component logging with single OLLIE_LOG={level}
- Replace OLLIE_USAGE_LOG with XDG_DATA_HOME-based path
- Replace OLLIE_OLLAMA_URL with standard OLLAMA_HOST (or omit entirely)
- Rename protocol markers: OLLIE_LISTEN_READY → ListenReady, OLLIE_9P_OPEN → Open
- Remove freeloader hooks from agent configs
- Update sandbox YAMLs to use XDG paths instead of OLLIE_*_PATH tokens
- Update shell tools to use $(dirname "$0") fallback instead of OLLIE_TOOLS_PATH
- Update docs and prompts accordingly
2026-08-07 07:11:53 +02:00
Ollie Agent 3f69427084 docs: standardize on {sname} and {aname} placeholder syntax 2026-08-04 19:29:00 +02:00
Ollie Agent 0f8cfd0c14 docs: replace agent/0 with agent/{aname} in path templates 2026-08-04 19:26:22 +02:00
Ollie Agent 7beef106e0 tool_load: add dynamic tool loader with bash script
Add a tool_load tool that writes a tool name to the session's 9P
tools file via ollie-9p, enabling on-demand tool loading.

Reduce autoLoad lists in default.json and theo.json to bare
essentials — everything else is loaded via tool_load.
2026-08-03 00:15:36 +02:00
Ollie Agent 088aa38f1c data/agents/default.json: remove hard-coded shell and reasoning_think from autoLoad
These two are built-in tools always available regardless of autoload.
No need to explicitly load them.
2026-08-02 21:16:43 +02:00
Ollie Agent e25157ffcd multiplex toolsrv, wip zero-tool server 2026-08-02 19:18:39 +02:00
Levi Neely 9b087f23d1 fix copilot.json: remove trailing comma 2026-07-31 14:19:58 +02:00
Ollie Agent 5021dedabe docs: replace /home/lkn/mnt/ollie/session/ paths with 9p commands 2026-07-31 08:36:47 +02:00
Ollie Agent 942cad2dee rename contrib/{prompts,scripts,services,tools,skills,agents} → data/
These are project data files, not community contributions.
contrib/elisp stays as-is.
2026-07-30 21:40:11 +02:00