Repository navigation
fix: automatically schedule CPU work and bound gateway memory - #134
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.