This repository has been archived on 2026-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
ollie-core/pkg/agent
Levi Neely 77dd5c6168 agent: refactor prompt architecture and session lifecycle
- Rename loopConfig→agentConfig, agentCore→agent, loopcfg→cfg, systemPrompt→preamble
  for clarity: the struct represents agent runtime config, the field is its config,
  and preamble accurately describes the compiled system+agent prompt sent as system role

- Separate preamble from agent context: preamble now contains only SYSTEM_PROMPT.md;
  agent prompt and agentSpawn hook output are injected into session history at
  context refresh points instead of being bolted onto the system role

- Replace fireAgentSpawn (mutated preamble once, guarded by agentSpawnFired flag)
  with spawnContext (assembles agent prompt + hook output, returns string for caller
  to inject); remove agentSpawnFired entirely — session==nil is the sufficient guard

- Three refresh points inject spawn context into session history:
  session start, post-clear (session=nil triggers same path), post-compaction
  (auto and manual)

- Move all preTurn tool primes (tools-file, tools-reasoning, tools-memory,
  tools-subagent, tools-elevate) to agentSpawn in all agent configs so they are
  injected at session refresh points alongside bd prime, not repeated every turn

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 19:38:18 +02:00
..
commands.go agent: refactor prompt architecture and session lifecycle 2026-04-25 19:38:18 +02:00
core.go agent: refactor prompt architecture and session lifecycle 2026-04-25 19:38:18 +02:00
core_test.go agent: refactor prompt architecture and session lifecycle 2026-04-25 19:38:18 +02:00
fifo_test.go agent: add PromptFIFO unit tests 2026-04-11 10:03:47 +02:00
hooks.go expand ~ in cwd across agent core, hooks, and execute server 2026-04-24 20:10:42 +02:00
loop.go agent: refactor prompt architecture and session lifecycle 2026-04-25 19:38:18 +02:00
session.go agent: refactor prompt architecture and session lifecycle 2026-04-25 19:38:18 +02:00
state.go agent: testability, dead code removal, coverage to 83% 2026-04-21 12:28:29 +02:00
types.go remove MCP support, add execute_code tests 2026-04-21 13:25:32 +02:00
waitchange_test.go agent: refactor prompt architecture and session lifecycle 2026-04-25 19:38:18 +02:00