Handle structured output review payloads#33
Merged
danielmartin merged 1 commit intoPSPDFKit-labs:mainfrom Mar 6, 2026
Merged
Conversation
Claude can return review data in `structured_output` even when the legacy `result` field is empty. The current parser only looks at `result`, so a valid review payload can be lost and the action can degrade into an empty review. This change checks `structured_output` first, falls back to parsing `result` for compatibility, and fails the review if neither contains a valid payload. The tests now cover the `structured_output` path and the failure case so the action does not silently approve malformed responses.
HungKNguyen
approved these changes
Mar 6, 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.
This fixes a failure mode in the review parser.
Right now we only parse Claude's serialized
resultfield. In recent runs, Claude sometimes returned the valid review payload instructured_outputwhileresultwas empty, which made the action drop a good response and degrade into an empty review.This patch checks
structured_outputfirst, falls back toresultfor compatibility, and fails the run if neither contains a valid review payload. That follows the same direction as Anthropic'sclaude-code-action, which treatsstructured_outputas the schema-backed output path: https://github.com/anthropics/claude-code-action/blob/main/base-action/src/run-claude-sdk.ts#L208-L228Tests are updated to cover the
structured_outputpath and the failure case.