fix(proxy): normalize optional Caido GraphQL arguments - #1142
Draft
gnai-creator wants to merge 2 commits into
Draft
fix(proxy): normalize optional Caido GraphQL arguments#1142gnai-creator wants to merge 2 commits into
gnai-creator wants to merge 2 commits into
Conversation
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
Normalize optional Caido GraphQL IDs and pagination cursors before passing them to the Caido SDK.
Some LLM tool calls encode omitted optional arguments as strings such as
"null"or"". These values are truthy and were being forwarded as GraphQLIDvariables. Caido expects integer-shaped i32 IDs or an actual null value, resulting in:Changes
"null","none", and"undefined"as omitted values.list_requests.scope_idlist_requests.afterlist_sitemap.scope_idlist_sitemap.parent_idWhy
The tool schema declares these fields as optional strings, but LLMs may emit a textual null instead of JSON null. Validation at the Strix/Caido boundary prevents invalid GraphQL requests and replaces SDK tracebacks with clear local errors.
Before this change,
scope_id="null"was sent to Caido asscopeId: "null"and rejected. Likewise,after="null"was forwarded as a pagination cursor and failed withFailed to parse cursor. After this change, both values are normalized toNone, so the omitted optional arguments are not sent to the SDK builders.Tests