Commit Graph

146 Commits

Author SHA1 Message Date
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
Levi Neely 9bb2e41e33 Add memory section to system prompt, fix icon resolution
- Add OptMem memory section to system_prompt.md with tool-based API
- Fix KRunner plugin icon: resolve via QStandardPaths instead of theme name
- Fix desktop file icon: use absolute path to bypass stale system icon
2026-08-19 10:02:51 +02:00
Ollie Agent af478550a9 Wake OptMem before restored session turns 2026-08-18 14:04:27 +02:00
Ollie Agent 2ba9ba036c Document native Landlock and persist session yolo 2026-08-18 12:49:25 +02:00
Ollie Agent bdafc30022 replace landrun with native Landlock sandbox 2026-08-18 12:36:27 +02:00
Ollie Agent c111cbd0ca Stop persistent loop timers 2026-08-18 07:34:56 +02:00
Ollie Agent e24675b8fa Handle random generation errors 2026-08-18 07:31:52 +02:00
Ollie Agent 2ee9251b5a Clean up toolsrv startup socket failures 2026-08-18 07:29:34 +02:00
Ollie Agent 9bbb6b9152 Make toolsrv socket polling cancellable 2026-08-18 07:27:42 +02:00
Ollie Agent a9f4899ed3 Clean up toolsrv startup errors 2026-08-18 07:22:41 +02:00
Ollie Agent f41a580dad Tie event subscription to server context 2026-08-18 07:00:31 +02:00
Ollie Agent 7ec8583e06 Honor cancellation during compaction streams 2026-08-18 06:59:35 +02:00
Ollie Agent c6d9b4aa23 Bound agent prompt queues 2026-08-18 06:58:38 +02:00
Ollie Agent e01d578303 Bound agent chat and summary caches 2026-08-18 06:57:15 +02:00
Ollie Agent 6c1de81cf9 Bound agent result cache 2026-08-18 06:55:25 +02:00
Ollie Agent 062642dfd3 Bound parallel tool dispatch 2026-08-18 06:54:48 +02:00
Ollie Agent 6a8e897fa5 Bound asynchronous session work 2026-08-18 06:53:51 +02:00
Ollie Agent d31d0661bd Drain remote toolsrv stderr until exit 2026-08-18 06:43:14 +02:00
Ollie Agent e24ed79355 Avoid keeper lock during process dialing 2026-08-18 06:41:34 +02:00
Ollie Agent 3c777667ff Fix paused session process lifecycle 2026-08-17 18:31:37 +02:00
Ollie Agent 701e9bcaad Prevent backend stream goroutine leaks 2026-08-17 18:27:35 +02:00
Ollie Agent 49e43248b0 Fix paused session resume lifecycle 2026-08-17 18:23:00 +02:00
Ollie Agent e1136fdb82 Cancel session context during close 2026-08-17 17:59:19 +02:00
Ollie Agent 16bf2115fa Cancel active agent work during shutdown 2026-08-17 17:57:14 +02:00
Ollie Agent 2599ccb4ac Clear stale agent actions on turn exit 2026-08-17 17:52:51 +02:00
Ollie Agent 4ac3b2135a Reap toolsrv processes on shutdown 2026-08-17 17:45:29 +02:00
Ollie Agent 2352f2483a Close feed consumer resources 2026-08-17 17:42:30 +02:00
Levi Neely 9147fd790a session: expand ~ and env vars in SetCwd 2026-08-17 14:29:02 +02:00
Levi Neely 8a1efe0907 session: require cwd, make agent cwd read-only, sanitize message history
Session creation now requires cwd= parameter (no fallback to daemon cwd).
Agent cwd is read-only — agents inherit from session, cannot override.

Frontends updated:
- NewSessionDialog: added Directory field with Browse button
- NewAgentDialog: removed Directory field
- createAgent(): removed cwd parameter
- Kate plugin: passes cwd when creating kate session
- Dolphin: removed cwd from agent/new call

Message history sanitization (backend.SanitizeMessages):
- Removes dangling tool calls (assistant with ToolCalls but missing results)
- Removes orphan tool results (tool message without preceding call)
- Applied before sub-agent context inheritance
- Applied before session persistence save
- Applied after compaction (defensive)

Includes unit tests for all sanitization cases.
2026-08-17 14:15:55 +02:00
Levi Neely 025c351dcb Fix ollie-9p UNAME fallback, goal file permissions
- ollie-9p: Fall back to USER when OLLIE_UNAME not set (remove fatal error)
- goal/goalstatus: Use mode 0666 (world readable/writable) while keeping GID agent
2026-08-17 13:46:44 +02:00
Levi Neely a17dd683df Split session/idx and agent/idx, fix sub-agent tree display
Server:
- session/idx now outputs: session-id, session-name, paused, connected, remote, cwd
- session/{s}/agent/idx now outputs: session-id, agent-id, agent-name, parent-id, depth, state
- Add error if parent agent not found during sub-agent spawn

GUI:
- refreshSessions() reads session index, then agent/idx per session
- Auto-select first top-level agent (depth 0) instead of first in list
- SessionModel tracks agent expansion separately from session expansion
- Agents with children show expand/collapse arrows and are collapsible
- Add hasChildren role to SessionModel

Tools:
- subagent_spawn now passes parent= argument for proper depth tracking
- Remove hardcoded max_depth=5, use server default of 1
- Makefile installs shell script tools from data/tools/

KRunner:
- Update to parse new session/idx format
2026-08-17 13:03:26 +02:00
Levi Neely 958d3d2ddf workflows: script-based workflows with session-level CWD
- Workflows are executable scripts in data/workflows/
- New 'workflows' 9P file lists available workflows
- Goal file stores text; writing triggers workflow if status allows
- goalstatus file for status read/write, goalwait for blocking
- Session ctl accepts 'run [workflow]' command
- Session now owns CWD; agents inherit via callback
- Conductor workflow: creates agent, primes with instructions, exits
- GUI workflow combo reads from workflows, not agents
- Persistence includes goal, goalstatus, workflow, and session CWD
2026-08-17 12:00:10 +02:00
Levi Neely 743e40c2f8 selectable workflow in new session 2026-08-17 10:52:53 +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
Levi Neely da0ee4456f sub-agent guardrails: depth, parallelism, timeout
Enforce three limits on sub-agent spawning:
- depth (default 1): sub-agents cannot spawn their own sub-agents
- parallelism (default unlimited): cap concurrent children per parent
- timeout (default 600s): sub-agents are killed after 10 minutes

Top-level agents are never constrained by timeout.

Also: refactored parseAgentNewRequest to return a struct instead of
4 positional values. Added depth/activeChildren fields to Agent.
OLLIE_SUBAGENT_DEPTH env var set on sub-agents.

Deferred: remove maxSteps (replace entirely with timeout).
2026-08-17 09:37:59 +02:00
Levi Neely ecb9406413 agent/new: fork_at= parameter for historical context forking
Sub-agents can now inherit parent context truncated at a specific
user turn: fork_at=5 means 'fork from the state after the 5th
user message.' Enables backtracking without losing unsummarized
context from before a failed approach.

Without fork_at (or fork_at=0), full history is inherited as before.
2026-08-17 09:04:57 +02:00
Ollie Agent 9789eb56ff show agent reasoning output 2026-08-17 00:08:27 +02:00
Ollie Agent 45ff8a2864 Remove legacy backend environment configuration 2026-08-16 19:48:52 +02:00
Ollie Agent e51a1d4ff7 Update architecture documentation and remove obsolete frontends 2026-08-16 19:21:26 +02:00
Ollie Agent 57aa906e5f move toolsrv client into olliesrv 2026-08-16 19:07:25 +02:00
Ollie Agent b321eed99f use 9fans client directly 2026-08-16 19:00:48 +02:00
Ollie Agent 16a2b72051 consolidate 9P clients 2026-08-16 18:56:11 +02:00
Ollie Agent 59c4ed23ac merge paths utilities into util 2026-08-16 18:37:03 +02:00
Ollie Agent 81933e5281 refactor toolsrv into client protocol and metadata packages 2026-08-16 17:22:59 +02:00
Ollie Agent e972b5666a add metrics queries and agent-scoped plans 2026-08-16 17:00:11 +02:00
Ollie Agent 9409920c61 Propagate parent ID for spawned sub-agents 2026-08-16 11:44:39 +02:00
Ollie Agent 72209239b0 Add parent IDs for sub-agents 2026-08-16 11:44:06 +02:00
Ollie Agent ab9fd60901 Document sub-agent context isolation 2026-08-16 11:39:21 +02:00
Ollie Agent e1ac2df3fb Lower tool output cap and add Markdown parsing 2026-08-16 11:31:31 +02:00