refactor: replace interface{} with any for improved type clarity
This commit is contained in:
parent
1bd144ac13
commit
670b433f1a
5 changed files with 15 additions and 15 deletions
|
|
@ -2270,7 +2270,7 @@ func (al *AgentLoop) buildCommandsRuntime(agent *AgentInstance, opts *processOpt
|
||||||
}
|
}
|
||||||
return al.channelManager.GetEnabledChannels()
|
return al.channelManager.GetEnabledChannels()
|
||||||
},
|
},
|
||||||
GetActiveTurn: func() interface{} {
|
GetActiveTurn: func() any {
|
||||||
turns := al.GetAllActiveTurns()
|
turns := al.GetAllActiveTurns()
|
||||||
if len(turns) == 0 {
|
if len(turns) == 0 {
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
|
|
@ -315,7 +315,7 @@ func spawnSubTurn(
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
case <-timeoutCtx.Done():
|
case <-timeoutCtx.Done():
|
||||||
// Check parent context first - if it was cancelled, propagate that error
|
// Check parent context first - if it was canceled, propagate that error
|
||||||
if ctx.Err() != nil {
|
if ctx.Err() != nil {
|
||||||
return nil, ctx.Err()
|
return nil, ctx.Err()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@ func (ts *turnState) Info() *TurnInfo {
|
||||||
// GetAllActiveTurns retrieves information about all currently active turns across all sessions.
|
// GetAllActiveTurns retrieves information about all currently active turns across all sessions.
|
||||||
func (al *AgentLoop) GetAllActiveTurns() []*TurnInfo {
|
func (al *AgentLoop) GetAllActiveTurns() []*TurnInfo {
|
||||||
var turns []*TurnInfo
|
var turns []*TurnInfo
|
||||||
al.activeTurnStates.Range(func(key, value interface{}) bool {
|
al.activeTurnStates.Range(func(key, value any) bool {
|
||||||
if ts, ok := value.(*turnState); ok {
|
if ts, ok := value.(*turnState); ok {
|
||||||
turns = append(turns, ts.Info())
|
turns = append(turns, ts.Info())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ type Runtime struct {
|
||||||
ListAgentIDs func() []string
|
ListAgentIDs func() []string
|
||||||
ListDefinitions func() []Definition
|
ListDefinitions func() []Definition
|
||||||
GetEnabledChannels func() []string
|
GetEnabledChannels func() []string
|
||||||
GetActiveTurn func() interface{} // Returning interface{} to avoid circular dependency with agent package
|
GetActiveTurn func() any // Returning any to avoid circular dependency with agent package
|
||||||
SwitchModel func(value string) (oldModel string, err error)
|
SwitchModel func(value string) (oldModel string, err error)
|
||||||
SwitchChannel func(value string) error
|
SwitchChannel func(value string) error
|
||||||
ClearHistory func() error
|
ClearHistory func() error
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue