fix(config): wire K8s env vars into HiveStack and API server#13
Draft
cursor[bot] wants to merge 1 commit into
Draft
fix(config): wire K8s env vars into HiveStack and API server#13cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
HiveConfig.from_env() was never used by hive_api_server.py, so K8s/Helm settings (HIVE_VALIDATE_INPUTS, HIVE_RATE_LIMIT, HIVE_MAX_NODES, HIVE_MAX_CONTENT_BYTES, TTL) had no effect at runtime. - Pass max_memory_nodes to RustBrain.max_nodes - Honor max_content_bytes from config when not overridden - Auto-create RateLimiter when HIVE_RATE_LIMIT > 0 - Accept HIVE_MAX_NODES alias used in deploy manifests - Load HiveConfig.from_env() in the REST API server - Fix AsyncHiveStack.remember() silently dropping trust/tags Regression tests added for env wiring, validation, and async remember. Co-authored-by: Daniel <DJLougen@users.noreply.github.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Bug and impact
K8s/Helm deployments set
HIVE_VALIDATE_INPUTS,HIVE_RATE_LIMIT,HIVE_MAX_NODES,HIVE_MAX_CONTENT_BYTES, andHIVE_DEFAULT_TTL_Svia ConfigMap/deployment env vars, butscripts/hive_api_server.pycreated a bareHiveStack()that never calledHiveConfig.from_env(). Enterprise controls were silently ignored at runtime — input validation, rate limiting, memory caps, and content-size limits had no effect in the REST API path.Concrete trigger: Deploy via
deploy/k8s/withHIVE_VALIDATE_INPUTS=trueandHIVE_RATE_LIMIT=1000, then POST an oversized agent state to/route. Before this fix, validation and rate limiting never ran despite operator configuration.Root cause
HiveConfigwas implemented and documented for env-based configuration, but:hive_api_server.pydid not load config from the environmentHiveStackdid not wiremax_memory_nodes,max_content_bytes, orrate_limitfromHiveConfigintoRustBrain/RateLimiterFix
HiveConfig.from_env()in the REST API servermax_nodesfromconfig.max_memory_nodestoRustBrainRateLimiterwhenHIVE_RATE_LIMIT > 0max_content_bytesfrom config when not explicitly overriddenHIVE_MAX_NODESalias (used in K8s manifests)AsyncHiveStack.remember()silently droppingtrust/tagsValidation
tests/test_enterprise_config.py,tests/test_hive_api_server.py, andtests/test_async_stack.py