Commit Graph

3 Commits

Author SHA1 Message Date
Levi Neely 517d18d405 agent: inject AGENTS.md from cwd into user context
If AGENTS.md exists in the working directory, its contents are injected
as a user message at session start and after compaction (via spawnContext).
Not part of the system prompt — lives in conversation history.
2026-07-30 09:39:58 +02:00
Levi Neely 24b9a0bdd3 session: remove Submit and agent pass-through methods
Session no longer has Submit(), IsRunning(), State(), Reply(), BackendName(),
ModelName(), AgentName(), CtxSz(), Cost(), Usage(), Context(), SystemPrompt(),
GenerationParams(), SetGenerationParams(), CompactionModel(), SetCompactionModel(),
ListModels(), Reactions(), React(), ReactTo(), PopQueue(), ToolCallCount().

Callers access the Agent directly via Session.Agent(). Session retains only
genuinely session-level operations: Agent(), Bus(), Close(), SetEnv(),
Interrupt(), Queue(), InjectSystemEvent(), CWD(), SetCWD(), SetSessionID(),
WaitChange(), persistence, and detach.

Agent.Submit now dispatches slash commands internally (HandleCommand) before
falling through to executeTurn.
2026-07-29 21:57:53 +02:00
Levi Neely 8e4cdaa4bd session: extract agent/ as separate package
Agent is now in ollie/agent with proper encapsulation:
- Unexported fields, exported methods as the API
- Own constructor (agent.NewAgent)
- Owns: turn execution, history, runtime, hooks, commands, compaction
- Session never reaches into agent internals

Session (ollie/session) is a thin host:
- Owns: persistence, session ID, env, detach delegation
- Delegates all agent operations through exported Agent methods
- handleCommand dispatches to agent.HandleCommand for agent-level commands

Agent-level commands (/model, /backend, /compact, /agent, etc.) live
in agent/commands.go and access internals directly (same package).

Session-level commands (/sessions, /save, /resume, /cwd, /help)
remain in session/commands.go.

Test files temporarily removed pending rewrite against new API.
The fifo_test.go passes as a sanity check.
2026-07-29 21:43:49 +02:00