fix: change const to let for policy reassignment in applyPreset#133
Closed
WuKongAI-CMU wants to merge 1 commit intoNVIDIA:mainfrom
Closed
fix: change const to let for policy reassignment in applyPreset#133WuKongAI-CMU wants to merge 1 commit intoNVIDIA:mainfrom
WuKongAI-CMU wants to merge 1 commit intoNVIDIA:mainfrom
Conversation
applyPreset() crashes with "Assignment to constant variable" when a sandbox has a policy without a network_policies section. Change the declaration from const to let so the fallback path can prepend the version field. Also export extractPresetEntries and parseCurrentPolicy for testing and add 9 unit tests covering all three pure helpers. Signed-off-by: Peter Tam <nickthetam@gmail.com> Signed-off-by: peteryuqin <peter.yuqin@gmail.com>
5 tasks
Contributor
Author
|
Closing to reduce my open PR count below the repo policy limit and refocus on a smaller set of higher-signal changes. I can revive this branch later if it becomes the right path again. |
mafueee
pushed a commit
to mafueee/NemoClaw
that referenced
this pull request
Mar 28, 2026
…tion (NVIDIA#145) * fix(server): add field-level size limits to sandbox and provider creation Closes NVIDIA#24 Add validate_sandbox_spec and provider field validation with named constants. Configure explicit 1MB tonic max_decoding_message_size. Inference routes excluded per NVIDIA#133 rearchitecture. * chore: remove issue number references from code comments --------- Co-authored-by: John Myers <johntmyers@users.noreply.github.com>
mafueee
pushed a commit
to mafueee/NemoClaw
that referenced
this pull request
Mar 28, 2026
…move implicit catch-all (NVIDIA#146) Remove multi-route CRUD system and replace with single managed cluster route (inference.local). Key changes: - Remove inference route CRUD RPCs and CLI commands - Remove InspectForInference OPA action; policy is binary allow/deny - Introduce AuthHeader enum and InferenceProviderProfile in navigator-core - Router is now provider-agnostic: auth style carried on ResolvedRoute - Replace InferenceRouteSpec with ClusterInferenceConfig (2 fields vs 8) - Rename proto: routing_hint->name, SandboxResolvedRoute->ResolvedRoute, GetSandboxInferenceBundle->GetInferenceBundle, drop sandbox_id param - Rename RouteConfig.route -> RouteConfig.name; use inference.local - Add 'nemoclaw cluster inference update' for partial config changes - Delete stale navigator.inference.v1.rs checked-in proto file - Update architecture docs, agent skills, and CLI reference Closes NVIDIA#133
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.
Summary
TypeError: Assignment to constant variablecrash inapplyPreset()when a sandbox has a policy without anetwork_policiessectionextractPresetEntriesandparseCurrentPolicyfor testabilityProblem
bin/lib/policies.js:94declarescurrentPolicyasconst, but line 136 reassigns it to prependversion: 1. This code path is reached when a sandbox has a policy YAML that doesn't contain anetwork_policies:key — theconstassignment throws at runtime.Fix
Change
const currentPolicytolet currentPolicyon line 94.Test plan
node --test test/policies-helpers.test.js— 9/9 passnode --test test/*.test.js— full suite 61/61 pass🤖 Generated with Claude Code