The agent always talks to a *Conn (never a *Server directly).
Replace the Runner interface with the concrete type throughout:
- Runtime.ToolServer is now *toolsrv.Conn
- BuildRuntime takes *toolsrv.Conn
- session.Config, SessionInfra, InfraConfig use *toolsrv.Conn
- All inline type assertions in agent.go deleted — methods called
directly on *Conn (SetEnv, SetCWD, Close, Detach, ListDetachedRaw,
SignalDetached, GetDetachedOutput, DismissDetached, SetAllowTools,
SetOnToolsChanged, Ping, ToolRegistryRevision)
- Added Conn.ToolRegistryRevision() that returns 0 (remote connections
don't support revision tracking; use push-based OnToolsChanged instead)
- Deleted the Runner interface and its test
- Renamed LoadToolOnRunner → LoadToolOnConn
- Stripped OLLIE_TOOLS_PATH, OLLIE_AGENTS_PATH, OLLIE_SKILLS_PATH,
OLLIE_PROMPTS_PATH, OLLIE_MEMORY_PATH, OLLIE_TMP_PATH from managed
list and defaults in env.go
- ToolsPath(), SkillsPath(), PromptsDirs(), AgentsDirs(), ollieTmpDir()
now derive from paths.CfgDir()/paths.DataDir() directly
- Removed shell-exec fallback from resolveExecPrompt() — only file
resolution remains
- Cleaned up env_test.go to match reduced managed set
- Updated stale comments referencing /home/lkn/.config/ollie/tools
- Skip SetupToolServer for paused sessions during restore
- Pause() and Resume() now persist state to disk
- Resume() sets up tool server from scratch for sessions restored paused
- IsConnected() returns false when paused
- Add SetPaused(), SetToolServer() methods
- ProcessKeeper.SetContext() for resume after pause
- Session index sorts active-first, paused-last
- CreateAgent accepts name= parameter
- Remove duplicate SetCwd method
- CreateEmpty(name, remote) now spawns remote toolsrv when remote is set
- requestSessionNew parses remote= argument
- Add Session.SetRemote() method
- Update kde submodule
- Rename AgentCfg.SaveSession/FlushSave to Save/Flush for brevity
- Remove restoreLegacySession — all sessions now use multi-agent format
- Pass Save/Flush callbacks to agents in CreateAgent and restore paths
- Add AuditLog fallback warning in NewAgent
- flushSave and SaveSession now use PersistSession instead of
agent.SaveFull, ensuring the multi-agent format with Name field
is consistently written
- Rename now calls PersistSession immediately so renamed sessions
survive server restart
The previous approach had two save formats (legacy single-agent via
agent.SaveFull, and new multi-agent via PersistSession) writing to
the same file. Since flushSave ran on every turn, it would overwrite
the Name field with the legacy format that didn't preserve it.
flushSave and SaveSession were passing empty string instead of
a.Name() as the sessionName argument to agent.SaveFull, causing
the session name to be lost on restart.
session/persist.go:
- New multi-agent format: PersistedSession with []PersistedAgent
- PersistSession saves ALL agents, not just first
- RestoreAllSessions returns []RestoredSession with []RestoredAgent
- Backward compatible: restores legacy single-agent format
fs/persist.go:
- Thin wrapper that creates AgentLogs for each restored agent
- Delegates to session.PersistSession/RestoreAllSessions
agent/agent.go:
- Added Messages() to get conversation history
- Added Usage() to get token/cost stats
agent/history.go:
- Added RestoreHistoryFromMessages for multi-agent restore
session/session.go:
- Added Remote() getter
Add 'kill' command to agent ctl (removes agent from session).
Add Session.RemoveAgent() method.
Remove activeAgentID field, Agent(), SetActiveAgent, and dead
WaitChange — 'active agent' is a GUI concept, not a server one.
All callers updated to iterate Agents() or use FindAgent(id).
- Session.Agent() now looks up activeAgentName in the agents slice
instead of returning agents[0]. Falls back to first agent if unset.
- Added SetActiveAgent(), FindAgent(), SaveFuncs() methods.
- New() and AddAgent() set activeAgentName automatically.
- CreateAgent: refactored to ADD to existing core session instead
of overwriting it. If sess.Core exists, builds the new agent via
agent.NewAgent() and adds it via Core.AddAgent().
- agent/new now lists all agents in the session directory.
- 9P path handlers (rootReaddir/Stat/Open) use FindAgent() and
AgentLogFor() to resolve agents by name/ID instead of using
the first agent exclusively.
- Added AgentLogFor(id) to fs Session for per-agent log lookup.
persistSession: check sess.Core.Agent() != nil before saving.
silently skip sessions with no agent instead of logging
'no active session' error on shutdown.
SaveSession: return nil (no-op) when there are no agents,
rather than returning an error that gets logged.