fix: make the policy health check satisfy json object mode - #300
Merged
Conversation
Owner
Author
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Bundle ReportBundle size has no change ✅ Affected Assets, Files, and Routes:view changes for bundle: engram-frontend-client-array-pushAssets Changed:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #300 +/- ##
=======================================
Coverage 91.03% 91.03%
=======================================
Files 221 221
Lines 23099 23099
=======================================
Hits 21029 21029
Misses 2070 2070 ☔ View full report in Codecov by Harness. |
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.
An OpenAI curation policy could never pass
engram_validate_policies/ the console's Test connection button.Observed on the stand right after migrating it to OpenAI:
Only curation failed, because it is the only task type whose health check uses a structured response kind:
_validation_response_kindreturnscandidatesfor curation,candidatesis in_STRUCTURED_RESPONSE_KINDS, andopenai_json_mode_overridetherefore setsresponse_format: json_objectfor an OpenAI policy. OpenAI rejects that unless the messages mention json, andVALIDATION_PROMPTdid not.Proved against the real API, both prompts, same policy shape:
Fix is the prompt itself. The test pins the relationship rather than the wording: it asserts that the curation health check's response kind really is a structured one, and that the prompt satisfies the mode that implies.
Pre-existing — it would have hit any OpenAI curation policy before this week; nobody had one until now.
Backend suites: 815 passed.
🤖 Generated with Claude Code