fix(caido): normalize string null and sentinels for scopeId and parentId (#1140) - #1151
Open
vardhans07 wants to merge 1 commit into
Open
fix(caido): normalize string null and sentinels for scopeId and parentId (#1140)#1151vardhans07 wants to merge 1 commit into
vardhans07 wants to merge 1 commit into
Conversation
Contributor
Greptile SummaryThis PR normalizes optional Caido scope and sitemap-parent identifiers, treating common string null sentinels as absent and validating supplied IDs as signed 32-bit integers.
Confidence Score: 4/5The PR appears safe to merge, with a non-blocking test-coverage gap around the production query-building paths. The normalization and call-site wiring are internally consistent, but the tests exercise only the helper and therefore do not protect the agent-facing filter and sitemap-query behavior. Files Needing Attention: tests/test_caido_api.py Important Files Changed
Prompt To Fix All With AI### Issue 1
tests/test_caido_api.py:8-9
**Call-site normalization remains untested**
These tests invoke only `_normalize_optional_id`, so they do not verify that sentinel scope IDs omit the request filter or that sentinel parent IDs select the sitemap roots query. Add call-site tests to protect the agent-facing behavior this change is intended to fix.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "fix(caido): normalize string null and se..." | Re-trigger Greptile |
vardhans07
force-pushed
the
fix/caido-null-scope-id
branch
from
August 23, 2026 10:58
0c165f4 to
36f2df6
Compare
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.
Closes #1140
Context & Fix
Some LLMs serialize omitted or null arguments as literal strings like
"null","none", or"undefined"instead of actualnull/None. Inlist_requestsandlist_sitemap, we were checking truthiness directly (if scope_id:), which allowed these strings to pass through to the Caido GraphQL query, throwing anInvalid ID format, should be an i32error.To fix this, I added a
_normalize_optional_idhelper incaido_api.pythat:None.scope_idandparent_idbefore building the requests.Also added test cases in

tests/test_caido_api.pyto cover these sentinel strings, valid numeric IDs, invalid non-integers, and integer overflow.