Commit Graph

2164 Commits

Author SHA1 Message Date
Levi Neely c25e2e708c doc: add sub-agents to evolution.md and README 2026-08-14 15:09:02 +02:00
Levi Neely 06cdc05c44 justfile: remove subagent_generate from install-data 2026-08-14 15:03:16 +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 165725fea8 subagent_spawn: rewrite to use 9P agent/new rdwr
Replace D-Bus fire-and-forget with blocking ollie-9p rdwr to
agent/new. The tool now:
- Blocks until the sub-agent completes
- Returns the sub-agent's reply directly
- Scope: read (multiple spawns run in parallel)
- Tier: hot

Removed: D-Bus dependency, session renaming, JIT config cleanup.
2026-08-14 14:55:17 +02:00
Levi Neely a8d087a080 system prompt: document sub-agent mechanism
Add Sub-Agents section explaining agent/new with prompt= key.
Include examples for single and parallel sub-agent spawning.
Update 9P namespace table to show agent/new as rdwr.
2026-08-14 14:52:53 +02:00
Levi Neely 839f463536 prompts: ban pointless indirection (thin wrappers/delegations) 2026-08-14 14:48:46 +02:00
Levi Neely 250ad4b233 agent/new: sub-agent support via rdwr with prompt=
Writing to session/{s}/agent/new with a prompt= key now blocks
until the agent completes its task, then returns the reply and
destroys the transient agent. Without prompt=, behaves as before
(creates agent, returns ID).

Also:
- Move ParsePayload/UnescapeValue to shared ollie/toolsrv package
- Remove duplicate implementations from cmd/toolsrv/internal/server
- Add session.CreateAgentWithParams for direct AgentParams usage
- Eliminate flattenParams/unescapeValue redundancy in fs package
2026-08-14 14:48:12 +02:00
Levi Neely ab4668cb3f virtfs: rename Request to Rdwr
Read, Write, and Rdwr are the three atomic 9P operations:
- Read: non-blocking read
- Write: non-blocking write (fire-and-forget)
- Rdwr: atomic write-then-read (blocking, produces result)

BlockOnce and Stream are special cases of Read.
Rdwr is its own primitive — not a variant of either.
2026-08-14 14:42:19 +02:00
Levi Neely 8b6b08b54f kde: update submodule (focus-stealing fix) 2026-08-14 14:27:45 +02:00
Levi Neely 5dcde264e6 toolsrv: add path-based lock table for cross-agent serialization
All foreground tool calls now acquire a lock based on the tool's
declared scope and file path before execution:

  - scope "read":  no lock (reads never conflict)
  - scope "write": exclusive lock on the file path
  - scope "global": exclusive global lock (serializes with everything)

This ensures writes to the same path serialize regardless of which
agent initiated the call, enabling safe parallel sub-agents within
a session without explicit coordination.

Cross-session serialization (shared toolsrv per host) is left as
future work.
2026-08-14 14:27:21 +02:00
Levi Neely ab79f6edd1 agent-coding prompt: anti-defensive-coding, prefer removing code 2026-08-14 08:51:11 +02:00
Levi Neely c61fada3e9 extract rebuildAgentRuntime, remove nil guards on things that must not be nil 2026-08-14 08:47:59 +02:00
Levi Neely 785fe0996f fix: rebuild full agent runtime on session resume
Paused sessions restored agents with stub Runtime (nil Backend,
nil Preamble). On resume, now rebuilds the complete runtime:
loads config, builds preamble, creates backend, loads tools.
Added Agent.SetRuntime for this path.
2026-08-14 08:45:54 +02:00
Levi Neely a8fd7a658f fix: nil Preamble on restored paused sessions
The persist path created agents with &Runtime{} (nil Preamble).
If a prompt arrived before resume rebuilt the runtime, Preamble.Set
panicked. Initialize with an empty Preamble.
2026-08-14 08:42:03 +02:00
Levi Neely 6d0a080e65 doc/usage.md: add link to tool-definitions.md 2026-08-13 22:43:49 +02:00
Levi Neely 2fa00f4a7d doc: remove bg proc caveat from context cancellation (it's correct behavior) 2026-08-13 22:40:40 +02:00
Levi Neely 7a5c542d28 move docs/ contents to doc/, remove empty dir 2026-08-13 22:38:26 +02:00
Levi Neely 2b27c9c165 update kde submodule 2026-08-13 22:37:26 +02:00
Levi Neely 4f8fd6956b update kde submodule 2026-08-13 22:31:12 +02:00
Levi Neely dc26871bdc proc/list: use fixed-width columns instead of tabs 2026-08-13 22:28:33 +02:00
Levi Neely 0fed1aa124 proc/list: include command in output 2026-08-13 22:24:50 +02:00
Levi Neely d64f6c1d76 proc: rename ListDetachedRaw→ListProcs, use proc/list rdwr (agent-filtered)
ListProcs now does rdwr to toolsrv proc/list with the agent ID.
Returns pre-formatted text. Ctl proc handler uses it directly.
Removed all ListDetachedRaw map-parsing logic.
2026-08-13 22:22:54 +02:00
Levi Neely 9246c44c0e agent: remove proc/detach/tool wrapper methods — inline in ctl handler
Removed from Agent: ListProcs, SignalProc, ProcOutput, DismissProc,
Detach, ListDetached, SignalDetached, GetDetachedOutput,
DismissDetached, BgProc type, DetachedInfo type.

The ctl handler now calls toolsrv client methods directly.
RefreshTools replaced by SetToolsPreamble + inline ListTools call.
renderTools exported as RenderTools.
2026-08-13 22:14:37 +02:00
Levi Neely c767ee10c9 ctl proc top: include STATUS column 2026-08-13 22:09:09 +02:00
Levi Neely de33f954e2 toolsrv: proc/list now rdwr with agent filtering
Write agent ID to filter, or empty for all. Returns pid\tstate\ttool.
Added ListProcsForAgent to State.
2026-08-13 22:08:15 +02:00
Levi Neely 48add8f7bb remove proc/ directory from agent namespace (processes live in toolsrv) 2026-08-13 22:01:06 +02:00
Levi Neely 6e5b1aa5f0 system prompt: remove proc/ from agent table (managed via ctl) 2026-08-13 21:59:34 +02:00
Levi Neely 6d4e7e237d system prompt: remove tools file from table (it's a ctl command, not a file) 2026-08-13 21:59:04 +02:00
Levi Neely fd4a3afa4f move tool catalog to toolsrv: add /all file, tools_all ctl command
- Remove /tools from olliesrv root (toolsrv owns all tool state)
- Add /all file to toolsrv namespace (lists all available tools on disk)
- Add ListAllTools() to toolsrv client library
- Add tools_all ctl command to agent (reads from toolsrv/all)
- Update system prompt with tools_all usage
2026-08-13 21:58:08 +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 a8cc7914e0 justfile: remove tool_load install line 2026-08-13 21:48:13 +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 ef640fb4be doc/architecture.md: combine philosophy paragraphs 2026-08-13 21:29:01 +02:00
Levi Neely 0eeef8eb4a doc/architecture.md: remove Emacs comparison from philosophy 2026-08-13 21:28:30 +02:00
Levi Neely e5d067ecf8 doc/architecture.md: fix event streaming description (pub/sub, not ring buffer) 2026-08-13 21:27:34 +02:00
Levi Neely 7b4eea5c00 doc/architecture.md: tool defs belong in toolsrv box 2026-08-13 21:25:06 +02:00
Levi Neely 22c34cf231 doc/architecture.md: remove dead ollie-remote from diagram 2026-08-13 21:24:27 +02:00
Levi Neely 2707bfce57 doc/architecture.md: fix ollie-remote (dead), fsedsl→virtfs, add feed+lib9p 2026-08-13 21:23:06 +02:00
Levi Neely e379a08c08 doc/9p.md: add feed file to namespace table and examples 2026-08-13 21:21:22 +02:00
Levi Neely 51d0576680 doc: add pair programming section, update evolution, fix o new syntax
- README: add 'Pair programming' to capabilities table
- usage.md: full section on observer agent setup + wiring patterns
- usage.md: update o new syntax to sname/aname form
- evolution.md: document feed + BlockOnce/Stream refactor session
2026-08-13 21:18:25 +02:00
Levi Neely 4061e494b3 remove ObserverFeed script — feed file replaces it 2026-08-13 21:10:22 +02:00
Levi Neely 324247b6a5 fs: remove dead streamChat and mergeCtx 2026-08-13 21:09:53 +02:00
Levi Neely 4bb08e860b toolsrv: fix shutdown ordering — close conn before draining
On context cancellation, close the connection first to unblock
ReadFcall. Then wait for in-flight handlers, drain the response
channel, and wait for the writer to finish. No writes hit a
closed socket.
2026-08-13 21:08:01 +02:00
Levi Neely d9026499fd toolsrv: suppress write errors during shutdown 2026-08-13 21:04:19 +02:00
Levi Neely bcaac146d2 server: on BlockOnce timeout, fall back to non-blocking Read
Frontends rely on getting the current state on timeout (heartbeat).
When BlockOnce returns empty (5s timeout), the server now calls the
plain Read handler as fallback. Files without a Read handler (like
feed) return nothing — consumer unaffected.
2026-08-13 20:59:05 +02:00
Levi Neely dd0021fd9a fix: restore sessions after 9P listener is ready
ConsumeFeed dials the 9P socket. Moving session restore to after
the listener starts ensures the socket exists when feed consumers
connect.
2026-08-13 20:55:02 +02:00
Levi Neely dcd119c853 virtfs: refactor Stream to accept (readFn, signalFn)
Same pattern as BlockOnce: framework handles the blocking loop.
readFn takes a base string, returns (data, nextBase, error).
signal fires when new data may be available.

Chat stream handlers now use Stream(a.ChatRead, a.ChatSignal).
StreamRaw retained for custom handlers.

streamChat() in support.go is now dead code (replaced by ChatRead).
2026-08-13 20:50:27 +02:00
Levi Neely 794673a5d0 virtfs: refactor BlockOnce to accept (readFn, signalFn)
BlockOnce now takes a value-reader and a signal source. The framework
handles the blocking loop: read → compare hash to base → if different
return → else wait on signal or timeout.

On timeout (ctx.Done), returns empty (not error) so clients re-open
cleanly.

BlockOnceRaw retained for queue-style handlers (bypass/pending,
proc/wait) that manage their own blocking.

EventValue adapter wraps a <-chan Event into BlockOnce-compatible
(readFn, signalFn) pair via a thin goroutine.
2026-08-13 20:44:50 +02:00