fix(worker): resolve busy-loop and add dynamic auto-scaling #354

Merged
review.bot merged 1 commit from fix/worker-busy-loop-and-autoscale into develop 2026-03-02 17:28:58 +00:00
Owner

Summary

  • Fix hub state corruption: handleTaskError in worker-hub now handles "Worker busy" rejections by setting a __busy__ sentinel instead of clearing currentTaskId, preventing the infinite retry loop that caused 500+ failed tasks
  • Add dispatch concurrency guard: isDispatching flag prevents overlapping async dispatchPendingTasks() calls
  • Add dynamic worker auto-scaling: New maybeScaleUpWorkers() spawns additional workers when all are busy (throttled to every 10s, respects MAX_WORKERS)
  • CSP fix: Allow Iconify CDN domains for UI-Kit icon loading
  • UI migration: Continue Nuxt 4 migration with settings components and dark theme fixes

Test plan

  • Deployed and verified: 0 "Worker busy" errors after fix
  • Auto-scaling working: workers scaled from 2 → 5 automatically
  • Failed task count stopped growing after deployment
  • Build passes (pnpm build)
## Summary - **Fix hub state corruption**: `handleTaskError` in worker-hub now handles "Worker busy" rejections by setting a `__busy__` sentinel instead of clearing `currentTaskId`, preventing the infinite retry loop that caused 500+ failed tasks - **Add dispatch concurrency guard**: `isDispatching` flag prevents overlapping async `dispatchPendingTasks()` calls - **Add dynamic worker auto-scaling**: New `maybeScaleUpWorkers()` spawns additional workers when all are busy (throttled to every 10s, respects MAX_WORKERS) - **CSP fix**: Allow Iconify CDN domains for UI-Kit icon loading - **UI migration**: Continue Nuxt 4 migration with settings components and dark theme fixes ## Test plan - [x] Deployed and verified: 0 "Worker busy" errors after fix - [x] Auto-scaling working: workers scaled from 2 → 5 automatically - [x] Failed task count stopped growing after deployment - [x] Build passes (`pnpm build`)
- Fix hub state corruption: "Worker busy" rejections now set __busy__
  sentinel instead of clearing currentTaskId, preventing infinite
  retry loops (500+ failed tasks)
- Add dispatch concurrency guard to prevent race conditions
- Add dynamic worker auto-scaling when all workers are busy (throttled
  to every 10s, respects MAX_WORKERS)
- Allow Iconify CDN in CSP for UI-Kit icon loading
- Continue Nuxt 4 UI migration (settings components, dark theme fixes)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
review.bot left a comment
Owner

AI Code Review (Devstral)

Fixes busy-loop bug and adds dynamic worker auto-scaling with CSP fix


Automated review by pr-reviewer

## AI Code Review (Devstral) Fixes busy-loop bug and adds dynamic worker auto-scaling with CSP fix --- *Automated review by [pr-reviewer](https://github.com/customable/pr-reviewer)*
review.bot merged commit 5202fa5c24 into develop 2026-03-02 17:28:58 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
customable/claude-mem!354
No description provided.