MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / stateModelForExecution

Method stateModelForExecution

sdk/cliproxy/auth/conductor.go:1153–1168  ·  view source on GitHub ↗
(auth *Auth, routeModel, upstreamModel string, pooled bool)

Source from the content-addressed store, hash-verified

1151}
1152
1153func (m *Manager) stateModelForExecution(auth *Auth, routeModel, upstreamModel string, pooled bool) string {
1154 if auth != nil && auth.Attributes != nil {
1155 if homeModel := strings.TrimSpace(auth.Attributes[homeUpstreamModelAttributeKey]); homeModel != "" {
1156 if resolved := strings.TrimSpace(upstreamModel); resolved != "" {
1157 return resolved
1158 }
1159 return homeModel
1160 }
1161 }
1162 stateModel := executionResultModel(routeModel, upstreamModel, pooled)
1163 selectionModel := m.selectionModelForAuth(auth, routeModel)
1164 if canonicalModelKey(selectionModel) == canonicalModelKey(upstreamModel) && strings.TrimSpace(selectionModel) != "" {
1165 return strings.TrimSpace(upstreamModel)
1166 }
1167 return stateModel
1168}
1169
1170func executionResultModel(routeModel, upstreamModel string, pooled bool) string {
1171 if pooled {

Callers 5

filterExecutionModelsMethod · 0.95
executeMixedOnceMethod · 0.95
executeCountMixedOnceMethod · 0.95

Calls 3

selectionModelForAuthMethod · 0.95
executionResultModelFunction · 0.85
canonicalModelKeyFunction · 0.85

Tested by

no test coverage detected