feat: validate_nodegroup_create — check the body before creating#41
Merged
Conversation
added 2 commits
July 14, 2026 18:29
Symmetric with validate_cluster_create, but node-group bodies are built from a chain of zone-scoped ids, so this validates against live discovery too (all cached — right after the discovery flow it costs zero extra API calls): - Local rules: name 5-15 chars (lowercase/digits/hyphens, letter/digit ends), autoScaleConfig.minSize <= maxSize, subnetId required. - Cross-checks: subnet belongs to the cluster's VPC (via _resolve_zone_context, reusing its actionable errors), flavorId is an available worker flavor in the subnet's zone, diskType is a volume-type id in that zone, sshKeyId and securityGroups exist in the cluster's region. - Collects EVERY problem in one pass, each pointing at the discovery tool that fixes it; returns "valid" otherwise. NodeGroupHandler now shares the server's DiscoveryCache. The nodegroup guide gains a validate step before the plan (mirroring the cluster guide), the create_nodegroup docstring workflow includes it, and SERVER_INSTRUCTIONS lists the tool in the chain. Docs: 41 tools. Verified live: a body with 4 planted errors reports all 4 with the right fix-it tools; a body assembled from real discovery returns "valid".
This was referenced Jul 14, 2026
Merged
vks-team
added a commit
that referenced
this pull request
Jul 14, 2026
…F-05) (#43) F-05a: validate said "valid" for an accented description while create_cluster then died with the backend 400 (^[a-zA-Z0-9-_. @]{0,255}$). The validator now applies that exact regex, and the constraint is stated everywhere an agent could miss it: the CreateClusterComboDto.description field description ("ASCII only... max 255"), the create_cluster docstring, and the cluster guide (the "nhập tự do" wording was actively misleading). F-05b: validate_nodegroup_create already shipped (#41) with the name rule; what was missing is the rule in the SCHEMA — NodeGroupSpec.name ("Node group name") and CreateClusterComboDto.name now spell out the 5-15 / 5-20 charset rules, and the nodegroup guide names the full rule instead of just "quá 15 ký tự". Co-authored-by: tytv2 <tytv2@vng.com.vn>
vks-team
added a commit
that referenced
this pull request
Jul 14, 2026
74d168a was pushed directly to main (process violation, bypassed branch protection) AND its premise was unproven: the field session that showed tables without the id column may simply have predated the instructions-level rule from #41 (instructions are only delivered at initialize). Docstrings are the tool contract; client rendering etiquette belongs at the instructions/skill layer. This revert keeps the ## Presenting results rule in SERVER_INSTRUCTIONS (#41). If a FRESH session still drops the id column, the docstring hint can be re-landed through a proper PR with that evidence. This reverts commit 74d168a06f2148633a5175908543cbd7a3743537. Co-authored-by: tytv2 <tytv2@vng.com.vn>
vks-team
added a commit
that referenced
this pull request
Jul 14, 2026
…rge race) (#47) * feat: instructions require the id column when rendering resources Field finding: the agent rendered the cluster table without the ID column — users then cannot reference resources in follow-up commands. New "## Presenting results" rule in SERVER_INSTRUCTIONS (always show each item's id next to its name; never drop the column), mirrored in the getting-started principles. Locked by a test. * feat: list_volume_types supports SSD — NVME by default, AUTO falls back Both disk types exist per zone (probed live); the tool had NVME hardcoded, making SSD invisible. New type_name param (pure enum, no anyOf-null): AUTO (default) prefers NVME and falls back to SSD when the zone has no NVME; NVME/SSD select explicitly. The output's type_name field says which type the tiers belong to, and the nodegroup guide explains the default/fallback/explicit-SSD rules. validate_nodegroup_create now accepts diskType ids from EITHER type (union of NVME + SSD tiers), so an explicit SSD choice is not flagged. Also, per field feedback on rendered tables: the Presenting-results rule now requires id and name as the FIRST two columns and forbids truncating ids (instructions + getting-started principles). Live-verified: AUTO->NVME (6 tiers), SSD->SSD (4 tiers) on HCM03-1B. --------- Co-authored-by: tytv2 <tytv2@vng.com.vn>
Merged
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.
What
The node-group symmetric of
validate_cluster_create— but node-group bodies are assembled from a chain of zone-scoped ids, so this validates against live discovery too (all cached: called right after the discovery flow it costs zero extra API calls).autoScaleConfig.minSize <= maxSize,subnetIdrequired._resolve_zone_contextand its actionable errors),flavorIdis an available worker flavor in the subnet's zone,diskTypeis a volume-type id in that zone,sshKeyId+securityGroupsexist in the cluster's region."valid"otherwise.Wiring:
NodeGroupHandlershares the server'sDiscoveryCache; the nodegroup guide gains a validate step before the plan (mirroring the cluster guide);create_nodegroup's workflow andSERVER_INSTRUCTIONSinclude the tool. Docs: 41 tools, Node group (10).Verification
HCM03-1B); a body assembled from real discovery returns"valid".