I’m spinning up a TypeScript module to override the default queue routing behavior inside the Electron main process, but the scoring pipeline keeps choking on the /api/v2/routing/queues/{queueId}/agents response shape. The endpoint returns a flat array of routingQueueAgent objects, yet my calculateAgentScore(agent, interactionContext) function expects nested skill proficiency maps. I’m mapping the raw payload with agents.map(a => ({ id: a.id, skills: a.skills.map(s => ({ name: s.name, proficiency: s.proficiency })) })) and feeding it into a weighted sum algorithm that multiplies proficiency by a dynamic contextWeight pulled from the interaction metadata. When I push the computed scores back to the internal config store via POST /internal/routing/config, the payload hits a 400 Bad Request because the score field refuses values above 100.0, even though the docs say it accepts floats. The tie-breaking logic using Math.random() on equal scores works in isolation, but the main process hangs when I try to batch the results for the simulation runner.
Switching to a least-busy fallback with agents.filter(a => a.currentlyWrappedCalls === 0).sort((x, y) => x.totalCalls - y.totalCalls) fixes the hang, yet the routing efficiency report generator spits out NaN for the throughputDelta metric. I’ve been tracing the getUserMedia stream state to ensure the softphone isn’t blocking the routing thread, but the event loop just keeps queuing microtasks. The dynamic config API endpoint I’m exposing at localhost:3000/api/route/update accepts the new thresholds, but the WebSocket subscription for real-time agent state changes drops frames when the scoring function runs longer than 150ms. The GC routing API seems to be silently truncating the weighted payload shape anyway.