Skip to content

Fix raw JSON rendering in classifier verdict display#2840

Closed
migeed-z wants to merge 1 commit intofacebook:mainfrom
migeed-z:export-D97422229
Closed

Fix raw JSON rendering in classifier verdict display#2840
migeed-z wants to merge 1 commit intofacebook:mainfrom
migeed-z:export-D97422229

Conversation

@migeed-z
Copy link
Contributor

Summary:
I noticed when looking at the classifier output for #2764 that the "verdict" formatting needed to be fixed.

Two fixes:

  1. formatter.py: Add _format_reason() to render JSON reason dicts as
    labeled readable sections (e.g. "Spec check: ...", "Reasoning: ...")
  2. llm_client.py: Ensure reason is always a string by serializing dict
    values, so downstream code handles it consistently.

Reviewed By: grievejia

Differential Revision: D97422229

Summary:
I noticed when looking at the classifier output for facebook#2764 that the "verdict" formatting needed to be fixed.

Two fixes:
1. formatter.py: Add _format_reason() to render JSON reason dicts as
   labeled readable sections (e.g. "**Spec check:** ...", "**Reasoning:** ...")
2. llm_client.py: Ensure reason is always a string by serializing dict
   values, so downstream code handles it consistently.

Reviewed By: grievejia

Differential Revision: D97422229
Copy link
Contributor

@grievejia grievejia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@meta-codesync
Copy link

meta-codesync bot commented Mar 21, 2026

@migeed-z has exported this pull request. If you are a Meta employee, you can view the originating Diff in D97422229.

@meta-codesync
Copy link

meta-codesync bot commented Mar 21, 2026

This pull request has been merged in 17bf21d.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants