use model snapshot to prevent unsync access to model
This commit is contained in:
parent
7660bf7c74
commit
ce9d338956
1 changed files with 9 additions and 9 deletions
|
|
@ -28,14 +28,14 @@ type SubagentManager struct {
|
||||||
registry *providers.ModelRegistry
|
registry *providers.ModelRegistry
|
||||||
defaultModelName string // registry key; looked up at spawn time
|
defaultModelName string // registry key; looked up at spawn time
|
||||||
bus *bus.MessageBus
|
bus *bus.MessageBus
|
||||||
workspace string
|
workspace string
|
||||||
tools *ToolRegistry
|
tools *ToolRegistry
|
||||||
maxIterations int
|
maxIterations int
|
||||||
maxTokens int
|
maxTokens int
|
||||||
temperature float64
|
temperature float64
|
||||||
hasMaxTokens bool
|
hasMaxTokens bool
|
||||||
hasTemperature bool
|
hasTemperature bool
|
||||||
nextID int
|
nextID int
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewSubagentManager(
|
func NewSubagentManager(
|
||||||
|
|
@ -72,7 +72,7 @@ func (sm *SubagentManager) UpdateModel(modelName string) {
|
||||||
defer sm.mu.Unlock()
|
defer sm.mu.Unlock()
|
||||||
sm.defaultModelName = modelName
|
sm.defaultModelName = modelName
|
||||||
}
|
}
|
||||||
// If not set, subagent will have access to the provided tools.
|
|
||||||
func (sm *SubagentManager) SetTools(tools *ToolRegistry) {
|
func (sm *SubagentManager) SetTools(tools *ToolRegistry) {
|
||||||
sm.mu.Lock()
|
sm.mu.Lock()
|
||||||
defer sm.mu.Unlock()
|
defer sm.mu.Unlock()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue