Skip to content

[codex] Add central warm capacity miss buckets#602

Merged
bill-ph merged 2 commits into
mainfrom
codex/dynamic-warm-capacity-pr-b
May 21, 2026
Merged

[codex] Add central warm capacity miss buckets#602
bill-ph merged 2 commits into
mainfrom
codex/dynamic-warm-capacity-pr-b

Conversation

@bill-ph
Copy link
Copy Markdown
Collaborator

@bill-ph bill-ph commented May 21, 2026

Summary

  • add warm_capacity_miss_buckets to the runtime configstore schema with atomic RecordWarmCapacityMiss upserts and janitor pruning
  • classify unfulfilled idle claims with explicit global-cap handling, while keeping existing idle workers claimable at cap
  • centralize warm-capacity miss policy for demand recording and client-facing SQL/error messages
  • record foreground no-idle misses by resolved worker image scope and keep non-demand reasons (org_cap, global_cap, shutting_down) out of dynamic-demand recording
  • merge current origin/main and preserve PR feat(controlplane): unbounded K8s worker scaling — remove memory-budget-derived MaxWorkers cap #597's unbounded K8s max_workers=0 semantics, higher spawn concurrency, and temporary local demand counter while routing its increments through the same policy

Why

PR A made warm-capacity failures typed, but PR B needs a shared durable signal so multiple control-plane pods can aggregate foreground capacity misses without directly spawning pods from user requests. This prepares PR C/D to compute bounded, image-scoped dynamic targets from configstore buckets instead of per-CP memory.

Validation

  • go test -tags kubernetes -run 'TestK8sPoolReserveSharedWorker|TestK8sPoolWarmCapacityDemandScalesPoolInOneTick|TestWarmCapacityMissPolicy|TestSessionCreationErrorResponse|TestControlPlaneJanitorRunPrunesWarmCapacityMissBuckets' ./controlplane
  • go test -run 'TestRecordWarmCapacityMiss|TestPruneWarmCapacityMissBuckets|TestClaimIdleWorker(ClaimsMatchingIdleWorkerAtGlobalCap|ReturnsGlobalCap|ReturnsNoIdleWhenBelowGlobalCap|ReturnsNilWhenNoIdleWorkerExists)' ./tests/configstore
  • git diff --check
  • just test-controlplane
  • just test-controlplane-k8s
  • just test-configstore-integration
  • just lint

@bill-ph bill-ph marked this pull request as ready for review May 21, 2026 18:34
@bill-ph bill-ph merged commit bd46d8c into main May 21, 2026
22 checks passed
@bill-ph bill-ph deleted the codex/dynamic-warm-capacity-pr-b branch May 21, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant