Skip to content

fix(PLU-272): migrate AI decompilation to v3 SDK endpoints#175

Merged
robertmarsal merged 2 commits into
mainfrom
fix-PLU-272
Jun 8, 2026
Merged

fix(PLU-272): migrate AI decompilation to v3 SDK endpoints#175
robertmarsal merged 2 commits into
mainfrom
fix-PLU-272

Conversation

@robertmarsal

@robertmarsal robertmarsal commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Switches the AI decompilation flow from the v2 task endpoint to the v3 SDK endpoints. A new AIDecompilationStatus record stitches the per-resource v3 responses back into a single polled value so the caller keeps its existing single-call polling loop.
  • v3 surfaces now hit: 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.
  • AI decompilation window changes: shows "Decompiling ..." while polling, splices inline comments into the displayed code as // comment lines above each targeted line (matching dashboard rendering), and keeps the predicted-name action wired to the value now coming from /tokenised.
  • Unrelated fix: "View function in portal" URLs now include view=functions so they land on the right tab.
image

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.
@robertmarsal robertmarsal merged commit cdfde8f into main Jun 8, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants