feat: verify pushed config and warn on fields the API did not persist#96
Open
aicayzer wants to merge 1 commit into
Open
feat: verify pushed config and warn on fields the API did not persist#96aicayzer wants to merge 1 commit into
aicayzer wants to merge 1 commit into
Conversation
- new findMissingPaths: presence-only subset check between the pushed config and what the API reports as persisted - agents push reads each agent back after create/update (including branch pushes) and warns with the dropped field paths - tools push verifies against the tool config already returned by the create/update response, so no extra API call is made - warnings are non-fatal and a failed verification read never fails the push The SDK serializes requests with unrecognizedObjectKeys: "strip", so any field the bundled SDK does not model is silently dropped before it reaches the API while the CLI reports success. This surfaces the dropped fields instead of printing an unconditional success.
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.
Problem
Push reports success purely from the HTTP response. The SDK serializes requests with
unrecognizedObjectKeys: "strip", so any field the bundled SDK doesn't model (or that reaches it miscased) is silently deleted before the request goes out, and the CLI still prints success. That's the common mechanism behind #90, #93 and #94, and it will recur whenever the platform adds a field before the SDK pin catches up (#82 is the flip side of the same problem).Fix
After a successful push, compare what was pushed against what the API reports as persisted, and warn with the exact dropped paths:
agents pushreads each agent back after create/update (including branch pushes) and runs a presence-only subset check (every locally specified key must exist live)tools pushchecks against the tool config already returned by the create/update response, so no extra API callExample output:
Design notes:
platform_settings.safetyblock) or changes inside arrays; it catches missing keys, which is the dominant failure mode heretools-vs-tool_idscleanup is mirrored on the expected side, so it isn't reported as a dropTests
16 new tests in
verify.test.ts: unit coverage of the path diff plus the agent/tool verification flows with mock clients (warning fires on a stripped response, silence on a clean push, read failure warns without failing the push). Full suite 218/218, lint and build clean.