Skip to content

Accept null diff/explanation in issue fix patches - #181

Closed
Ibrahimrahhal wants to merge 1 commit into
mainfrom
cursor/cli-null-patch-fields-48f5
Closed

Ibrahimrahhal wants to merge 1 commit into
mainfrom
cursor/cli-null-patch-fields-48f5

Conversation

@Ibrahimrahhal

Copy link
Copy Markdown
Member

Summary

GET /api/v1/issue/{id} can return auto_fix_suggestion.patch with "diff": null. That happens on backends older than doghouse's fix.diff or "" coalescing, for fixes that have no patch (for example, unsupported findings). "explanation": fix.explanation is also sent without coalescing. The CLI deserialized both into required String fields, so corgea inspect --issue and every other caller of get_issue failed with:

Failed to parse response: invalid type: null, expected a string at line 1 column N

Change

  • Patch.diff and Patch.explanation now read null (or a missing field) as an empty string. Downstream code already treats "" as "no patch", so nothing else changes.
  • Added a unit test that parses an issue response whose patch fields are both null.

Testing

  • ./harness check: all checks pass (943 tests).
Open in Web Open in Cursor 

GET /issue/{id} can return "diff": null (older backends, fixes with no
patch such as unsupported findings) and never coalesces "explanation".
Both were required strings, so corgea inspect --issue and any caller of
get_issue failed with 'invalid type: null, expected a string'. Read null
as an empty string instead.

Co-authored-by: ibrahim <ibrahim@corgea.com>
@Ibrahimrahhal
Ibrahimrahhal deleted the cursor/cli-null-patch-fields-48f5 branch September 30, 2026 11:46
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