37 lines
1.2 KiB
Go
37 lines
1.2 KiB
Go
package agent
|
|
|
|
import (
|
|
"encoding/json"
|
|
|
|
"ollie/backend"
|
|
"ollie/toolsrv"
|
|
)
|
|
|
|
// 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
|
|
ExecServer toolsrv.Runner // the execute server (tool runtime, env, cwd)
|
|
Hooks Hooks
|
|
Preamble string // compiled system prompt
|
|
Tools []backend.Tool
|
|
Exec toolExecutor
|
|
ClassifyTool toolClassifier
|
|
ClassifyTier func(string, json.RawMessage) ResultTier
|
|
GenParams backend.GenerationParams
|
|
MaxSteps int
|
|
// 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
|
|
// CompactionModel overrides the model used for context compaction.
|
|
// Resolved from: agent config > OLLIE_COMPACTION_MODEL env > per-backend default.
|
|
CompactionModel string
|
|
// Messages holds non-fatal warnings from runtime construction
|
|
// (e.g. tool listing errors). Surfaced once at session start.
|
|
Messages []string
|
|
}
|