fix(spawner): Allow runtime bot spawning after startup phase completes

The StartupSpawnOrchestrator was blocking ALL bot spawning once
startup phases completed (Phase 5 = COMPLETED). This prevented:
- Warm pool bots from logging in for BG queues
- JIT bots from spawning for on-demand content
- Any runtime spawn requests

The orchestrator now checks if the priority queue has items in
COMPLETED phase and allows spawning to proceed. This enables:
- Warm pool bot login: bots already queued for spawn via BotSpawner
- Runtime spawning: new bot requests after startup
- BG queue population: bots can now actually join queues

Evidence from logs showed:
- "BG shortage fully satisfied from warm pool" (bots selected)
- "Queued pool bot Player-1-XXXX for login via BotSpawner"
- But "Phase 2 throttling active - spawn deferred" (blocked!)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Signed-off-by: luis <[email protected]>
This commit is contained in:
agatho
2026-02-04 20:33:02 -03:00
committed by luis
co-authored by Claude Opus 4.5
parent cc9da83744
commit c58145d6d2
@@ -186,9 +186,29 @@ bool StartupSpawnOrchestrator::ShouldSpawnNext() const
if (!_initialized || !_startupBegun)
return false;
// No spawning if startup complete
// ========================================================================
// CRITICAL FIX: Allow runtime spawning after startup completes
// ========================================================================
// Previously, this returned false when COMPLETED, which blocked ALL spawning
// including runtime requests (BG queue, party invites, etc.).
// Now we allow spawning in COMPLETED phase if there are items in the queue.
// ========================================================================
if (_currentPhase == StartupPhase::COMPLETED)
{
// Allow runtime spawning - just check throttler and queue
if (_throttler && !_throttler->CanSpawnNow())
return false;
// In COMPLETED phase, allow any queued requests to spawn
if (_priorityQueue && !_priorityQueue->IsEmpty())
{
TC_LOG_TRACE("module.playerbot.orchestrator",
"Runtime spawn allowed in COMPLETED phase (queue has {} items)",
_priorityQueue->GetTotalQueueSize());
return true;
}
return false;
}
// Check if throttler allows spawning
if (_throttler && !_throttler->CanSpawnNow())