Commit Graph

2185 Commits

Author SHA1 Message Date
Ollie Agent 32180bee4d defer cold summaries until needed 2026-08-15 13:27:16 +02:00
Ollie Agent f167168df3 incrementalize cold summaries 2026-08-15 13:13:22 +02:00
Ollie Agent 25d502cfc2 cache cold result summaries 2026-08-15 13:10:15 +02:00
Ollie Agent b6584d35e7 cancellation persistence fix 2026-08-15 12:59:21 +02:00
Ollie Agent f38b130111 explicit summary state on stripCold 2026-08-15 12:55:04 +02:00
Ollie Agent f4cb1ea290 validate cold history summaries 2026-08-15 12:42:28 +02:00
Ollie Agent 329edc3218 account for stripCold in cost 2026-08-15 12:37:13 +02:00
Ollie Agent e4c24e8a5f fix cancellation and configure compaction model 2026-08-15 12:29:55 +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 93f021f068 feat: add userPrompts config field for active global rules
- Add UserPrompts Prompt field to AgentConfig (same JSON format as prompt).
- Resolve userPrompts via resolvePrompt() in BuildRuntime, store in Runtime.UserPrompt.
- Prepend resolved user prompts to every user message at executeTurn start.
- Document userPrompts in data/agents/README.md.
2026-08-15 11:52:21 +02:00
Ollie Agent 80d398dd88 doc: add userPrompts field to agent config README 2026-08-15 11:52:13 +02:00
Ollie Agent f61a93e426 refactor: move stripCold to executeTurn, replace clone with rollback pointer
- Remove per-step stripCold from run(); call once per turn in executeTurn
  after accumulator reset and before preamble injection.
- Replace expensive deep-clone snapshot with pre-turn length truncation.
- Delete unused cloneMessages() helper.
2026-08-15 11:30:19 +02:00
Ollie Agent e0f846bd31 fix: batch preamble injection and stripCold into single LLM calls
- Remove per-step preamble prepending in loop.go; inject once at turn start
  in turn.go instead of re-sending thousands of tokens every tool step.
- Re-inject preamble after overflow retry compaction where it was lost.
- Replace stripCold() N sequential LLM calls with one batched call that
  summarizes all cold-zone tool results via a single JSON response.
2026-08-15 11:16:49 +02:00
Levi Neely cca3d9a3f2 evolution: add superpowerd→bypass arc to reversals 2026-08-14 15:49:58 +02:00
Levi Neely df409cac9f evolution: add .meta sidecar→definition transition to reversals 2026-08-14 15:48:34 +02:00
Levi Neely b1fb81e539 evolution: add sub-agent dead ends to reversals table 2026-08-14 15:45:47 +02:00
Levi Neely cafba41193 docs: update for Request→Rdwr rename and sub-agent examples 2026-08-14 15:33:25 +02:00
Levi Neely 6a023391f9 credits: Ritchie, Thompson, Pike 2026-08-14 15:30:46 +02:00
Levi Neely 617bb5586a subagent: inherit parent context via parent= parameter
Sub-agents now clone the parent agent's conversation history into
their initial context. The tool script passes parent=$OLLIE_UNAME
automatically. Mechanically identical to session restore — uses
RestoreHistoryFromMessages on the parent's Messages().
2026-08-14 15:12:16 +02:00
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