package agent import ( "ollie/pkg/backend" "ollie/pkg/tools" ) func (r *Runtime) toolResultMaxBytes() int { if r.ToolResultMaxBytes > 0 { return r.ToolResultMaxBytes } return defaultToolResultMaxBytes } // Runtime holds the swappable per-agent configuration. It contains everything // that changes on an /agent switch but is stable across turns within the same // agent. The agent struct stores a pointer to the active Runtime; switching // agents replaces it atomically. type Runtime struct { Backend backend.Backend Dispatcher tools.Dispatcher Hooks Hooks Preamble string // compiled system prompt Tools []backend.Tool Exec toolExecutor ClassifyTool toolClassifier ClassifyTier func(string) ResultTier GenParams backend.GenerationParams MaxSteps int ToolResultMaxBytes int // 0 means use defaultToolResultMaxBytes // CfgBackend and CfgModel are the backend/model overrides from the agent // config JSON. Empty means no override. Applied by the caller after // BuildRuntime returns. CfgBackend string CfgModel string // Messages holds non-fatal warnings from runtime construction // (e.g. tool listing errors). Surfaced once at session start. Messages []string }