fix: preserve user-defined keys nested below preserved tiers#95
Open
aicayzer wants to merge 1 commit into
Open
fix: preserve user-defined keys nested below preserved tiers#95aicayzer wants to merge 1 commit into
aicayzer wants to merge 1 commit into
Conversation
- names-only preservation now handles a preserved-tier key nested inside another preserved tier: the key itself is converted while its children are preserved - add dynamic_variable_placeholders and properties to PRESERVE_CHILD_KEYS - fixes agents/tools push silently dropping all dynamic_variable_placeholders changes (the snake_case wrapper key was stripped by the SDK request serializer before reaching the API) - fixes query_params_schema and request_body_schema property names being camelCased on push with required[] left referencing the old names, and the mirrored conversion on pull
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.
Fixes #93, fixes #94.
Problem
The
PRESERVE_CHILD_KEYSpreservation intoCamelCaseKeys()/toSnakeCaseKeys()is exactly one level deep. Two real bug families live one level lower:dynamic_variables.dynamic_variable_placeholders.<name>: the wrapper key stays snake_case, the SDK request serializer (unrecognizedObjectKeys: "strip") doesn't recognise it and deletes the whole field, so every placeholder change pushed via the CLI is a silent no-op (agents push silently ignores all changes to dynamic_variable_placeholders #93)query_params_schema.properties.<name>andrequest_body_schema.properties.<name>(any depth): user-defined property names get camelCased whilerequiredkeeps the original strings (user-defined keys under properties (query_params_schema, request_body_schema) are camelCased on push, leaving required[] mismatched #94)Before this change:
After:
Fix
'names-only'mode now consultsPRESERVE_CHILD_KEYS: a preserved-tier key nested directly inside another preserved tier (e.g.dynamic_variable_placeholdersunderdynamic_variables) is converted itself while its children are preserved. Mirrored intoSnakeCaseKeys, which fixes the pull direction toodynamic_variable_placeholders/dynamicVariablePlaceholdersandpropertiesto the set.propertieschildren are user-defined JSON-schema property names everywhere in this API (checked everypropertiesfield in the SDK's types; all are user-keyedRecords), and because normal-mode recursion re-applies the set at every level, nestedrequest_body_schemaobjects are covered at any depthBehaviour is unchanged for flat
dynamic_variablesmaps (test configs),request_headers,language_presets,data_collection,model_usageandnodes/edges; the existing suite covers these and still passes.Known limitation: a user-defined key that exactly matches a preserved-tier name (e.g. a
data_collectionitem literally namedproperties, or a workflow node nameddynamic_variables) is now treated as a nested tier inside preserved contexts. That's inherent to any name-based preservation heuristic; flagging it here for the record.Tests
13 new tests: 7 transform-level (
utils.test.ts) and 6 through the real API functions with mock clients (casing.test.ts), covering push, pull and round-trip for both families. All 6 seam tests fail on main without the fix. Full suite 215/215, lint and build clean.Note: built on main independently of #92 (which adds
path_params_schemato the same set); happy to rebase whichever lands second.