fix(PLU-272): migrate AI decompilation to v3 SDK endpoints#175
Merged
Conversation
Switch the AI decompilation flow off the v2 task endpoint onto the v3
endpoints exposed by the latest SDK. The v2 single-payload response is
reassembled from the per-resource v3 endpoints into a new
`AIDecompilationStatus` record so callers keep their single-call polling
shape:
* POST `/v3/.../ai-decompilation` to trigger
* GET `/v3/.../ai-decompilation` for decompilation + workflow status
* GET `/v3/.../ai-decompilation/summary` for the summary
* GET `/v3/.../ai-decompilation/tokenised` for the predicted name
* GET `/v3/.../ai-decompilation/inline-comments/status` + data for
inline comments, with auto-trigger when uninitialised
Inline comments are spliced into the displayed decompilation as `//`
lines above each targeted line, matching the dashboard's rendering.
The window now shows a "Decompiling ..." placeholder while polling
instead of leaving the initial placeholder text in place. The tokenised
fetch is wrapped in a wider catch because the live API omits some
fields the generated `FunctionMapping` model marks required, which
makes the SDK throw `IllegalArgumentException` during JSON validation.
Rating still uses the v2 endpoint because the SDK doesn't expose a v3
equivalent yet.
The dashboard's function deep-link format is `/analyses/<id>?view=functions&fn=<fn>`. Without the `view=functions` query param, "View function in portal" landed on the wrong tab.
vgoat21
approved these changes
Jun 8, 2026
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
AIDecompilationStatusrecord stitches the per-resource v3 responses back into a single polled value so the caller keeps its existing single-call polling loop.POST /v3/.../ai-decompilation(trigger),GET /v3/.../ai-decompilation(decomp + workflow status),/summary,/tokenised(for the predicted function name), and/inline-comments/status+/inline-comments(auto-triggering generation when uninitialised). Rating stays on the v2 endpoint because the SDK has no v3 equivalent.// commentlines above each targeted line (matching dashboard rendering), and keeps the predicted-name action wired to the value now coming from/tokenised.view=functionsso they land on the right tab.