Skip to content

fix: automatically schedule CPU work and bound gateway memory - #134

Merged
fylorn merged 2 commits into
devfrom
codex/enterprise-auto-resources
Nov 3, 2026
Merged

fylorn merged 2 commits into
devfrom
codex/enterprise-auto-resources

Conversation

@fylorn

@fylorn fylorn commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Large hosts kept a permanent Tokio worker per CPU while AI/MCP buffering, audit retries and password hashing could retain memory without a shared process limit. Automatically size execution and memory admission from usable CPUs and cgroup/physical memory, without requiring configuration changes.

CPU-heavy gateway work now uses elastic execution with a 10-second idle retirement policy; a sufficiently provisioned 80-CPU machine can still run 80 jobs. Request/response buffers, bounded Redis reads and streaming capture retain admission through conversion, slow consumers and detached tails. Local pressure returns retryable 429/MCP errors without tripping upstream breakers. Audit queue/retry bytes and Argon2 workspaces have separate admission. MCP catalog discovery, provider/registry probes, OAuth exchange/discovery, audit forwarder diagnostics and S3 reads also use bounded reads. Adopt mimalloc, a process-local Linux THP policy and Core 0.89.0.

Validation: Linux CI passed all 939 unit tests and all 492 PostgreSQL/Redis/ClickHouse integration tests, plus Clippy, formatting and frontend checks (211 tests and production build). Local workspace all-target Clippy with warnings denied and integration test linking also passed. The existing ClickHouse TCP backlog fixture fails locally on macOS because the OS resets a full accept queue; it passes in Linux CI. Added coverage for 80-job expansion and retirement, cancellation ownership, chunked admission, stream pressure/replay, real Redis bytes and audit retry retention. See docs/operations/resources.md for policy and observability.

Size execution from CPU and cgroup memory availability, retain buffer admission through AI/MCP responses and stream tails, bound audit backlog bytes and password hashing, and adopt Core 0.89.0. Add cancellation, elastic execution, bounded HTTP/Redis and audit ownership coverage.
Apply shared response admission to MCP tool catalogs, provider and registry probes, OAuth discovery and credential exchange, audit forwarder errors and S3 reads. Retain decoded catalog admission while persisting results and bound protocol-probe draining time.
@fylorn
fylorn merged commit dee3c39 into dev Nov 3, 2026
7 checks passed
@fylorn
fylorn deleted the codex/enterprise-auto-resources branch November 3, 2026 06:27
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant