fix(runner): use c.Config().Get() instead of ConfigGet generic
ConfigGet type assertion fails across package boundaries — agentic stores map[string]agentic.ConcurrencyLimit but runner tries to retrieve map[string]runner.ConcurrencyLimit. Use Core's c.Config().Get() → Result → type assert instead. This is why concurrency limits were never enforced. Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
53db749738
commit
63db9e8733
2 changed files with 8 additions and 4 deletions
|
|
@ -251,10 +251,12 @@ func baseAgent(agent string) string {
|
|||
//
|
||||
// codex: {total: 2, models: {gpt-5.4: 1}} → max 2 codex total, max 1 gpt-5.4
|
||||
func (s *PrepSubsystem) canDispatchAgent(agent string) bool {
|
||||
// Read concurrency from shared config (loaded once at startup)
|
||||
var concurrency map[string]ConcurrencyLimit
|
||||
if s.ServiceRuntime != nil {
|
||||
concurrency = core.ConfigGet[map[string]ConcurrencyLimit](s.Core().Config(), "agents.concurrency")
|
||||
r := s.Core().Config().Get("agents.concurrency")
|
||||
if r.OK {
|
||||
concurrency, _ = r.Value.(map[string]ConcurrencyLimit)
|
||||
}
|
||||
}
|
||||
if concurrency == nil {
|
||||
cfg := s.loadAgentsConfig()
|
||||
|
|
|
|||
|
|
@ -107,8 +107,10 @@ func (s *Service) loadAgentsConfig() *AgentsConfig {
|
|||
func (s *Service) canDispatchAgent(agent string) bool {
|
||||
var concurrency map[string]ConcurrencyLimit
|
||||
if s.ServiceRuntime != nil {
|
||||
concurrency = core.ConfigGet[map[string]ConcurrencyLimit](
|
||||
s.Core().Config(), "agents.concurrency")
|
||||
r := s.Core().Config().Get("agents.concurrency")
|
||||
if r.OK {
|
||||
concurrency, _ = r.Value.(map[string]ConcurrencyLimit)
|
||||
}
|
||||
}
|
||||
if concurrency == nil {
|
||||
cfg := s.loadAgentsConfig()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue