Repository navigation
fix: guard symbol collection against 4.72.2 validation constraints - #180
Merged
Merged
Conversation
revengai 4.72.2 tightened the pydantic constraints on two models the plugin constructs by hand: FunctionBoundary.mangled_name StrictStr -> min_length=1, max_length=4096 FunctionBoundary.start_address StrictInt -> ge=0 FunctionBoundary.end_address StrictInt -> ge=0 Symbols.base_address StrictInt -> ge=0 Symbols.function_boundaries List -> max_length=200000 collect_symbols_from_ida fed idc.get_func_name() straight into mangled_name. That returns "" for an unnamed function, which now fails min_length=1 and raises ValidationError out of the whole collection pass -- so upload would break outright on any binary containing one. The boundary list was also unbounded, and a negative image base would trip ge=0. Skip boundaries with no name rather than inventing one, truncate over-long names, clamp the base address, and cap the list, warning when either the skip count or the cap is non-zero so the truncation is not silent. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
revengai 4.72.2 marks 85 operations deprecated, up from 25. Eight of the nine
the plugin called now emit a DeprecationWarning at call time and have a v3
successor; this moves them over.
Every v2 operation returned a BaseResponseX envelope with a .data attribute.
Every v3 operation returns a flat *OutputBody. So each migration is: swap the
method, drop the .data unwrap, remap fields.
ConfigApi.get_config -> ConfigApi.v3_get_config
AnalysesCoreApi.get_analysis_status -> AnalysesCoreApi.v3_get_analysis_operation
AnalysesCoreApi.get_analysis_function_map
-> FunctionsCoreApi.v3_get_analysis_func_maps
AnalysesCoreApi.list_analyses -> AnalysesCoreApi.v3_list_analyses
AnalysesCoreApi.upload_file -> BinariesApi.v3_upload_file
SearchApi.search_binaries -> BinariesApi.v3_search_binaries
SearchApi.search_collections -> CollectionsApi.v3_list_collections
FunctionsAIDecompilationApi.upsert_ai_decompilation_rating
-> ..._api.v3_upsert_ai_decompilation_rating
Notes on the non-obvious ones:
SearchApi is now deprecated in its entirety -- it has zero non-deprecated
operations. Binary search moves to GET /v3/binaries and collection search to
GET /v3/collections; both swap page/page_size for limit/offset.
CollectionListItemBody renames six fields off CollectionSearchResult
(scope, last_updated_at, created_at, owned_by, tags, size).
Analysis status moves to the long-running-operation endpoint
GET /v3/operations/analyses/{analysis_id}, whose CreateMetadata.status carries
the same platform status string v2 returned, so the Complete/Error state
machine is unchanged.
v3_upload_file drops packed_password. That parameter was dead plumbing here:
declared and threaded between _upload_file_req and upload_user_file but never
supplied by any caller. Archive passwords moved to the sandbox side of the
platform (SandboxConfig.archive_password), so it is removed rather than
reimplemented.
Also handle the types_applied AI-decompilation stream event, new in 4.72.2 as
the EventTypesApplied oneOf variant. The hand-rolled SSE parser keys off event
names and had no branch for it, so those events were dropped silently.
AnalysesCoreApi.create_analysis stays on v2: POST /v2/analyses is deprecated
but has no v3 successor in the live v4.73.0 spec. It is now the only deprecated
SDK call left in the plugin. The remaining /v2 calls -- IAMUsersApi.get_me and
the seven ConversationsApi operations -- are not deprecated and have no /v3
paths in the spec.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
refactor: migrate the deprecated v2 endpoints onto v3
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.
Stack: #178 → #179 → this → (endpoints PR). Merge in order, or retarget as each lands.
Why
4.72.2 added client-side pydantic constraints to two models the plugin constructs by hand. These raise
ValidationErrorat construction where 4.20.0 silently accepted the value:collect_symbols_from_idafedidc.get_func_name()straight intomangled_name. That returns""for an unnamed function, which now failsmin_length=1and raises out of the entire collection pass — upload breaks outright on any binary containing one unnamed function. The boundary list was also unbounded, and a negative image base would tripge=0.This is the one part of the 4.72.2 upgrade that is a live crash rather than a deprecation warning, which is why it is its own PR ahead of the endpoint migration.
What
build_function_boundary— skips a boundary with no name rather than inventing one, truncates over-long names to 4096.build_symbols— clamps the base address to>= 0and caps the list at 200000.Extracting the two builders also makes the constraints testable without a live IDA database — the new tests are pure unit tests, no idalib.
Verification
Green in isolation on this branch (not just on top of the endpoints PR):
Covering: empty
mangled_name, over-longmangled_name, negative addresses, and the >200000 cap.🤖 Generated with Claude Code