mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-21 00:21:49 +00:00
ci(duplicate-check): drop the unused considered field from the verdict schema
The flag step never read it: parseVerdict destructures duplicate_of, confidence and evidence only, so considered cost tokens on every issue and went straight on the floor. The parse test now covers extra keys being dropped instead of asserting a field that no longer exists.
This commit is contained in:
parent
5bad1a85f7
commit
0d3001d41c
3 changed files with 7 additions and 7 deletions
1
.github/prompts/duplicate-issue-check.md
vendored
1
.github/prompts/duplicate-issue-check.md
vendored
|
|
@ -48,4 +48,3 @@ Return only JSON:
|
|||
- `duplicate_of`: the issue number of the earlier report, or `null`
|
||||
- `confidence`: 0.0 to 1.0
|
||||
- `evidence`: one sentence naming the shared root cause and symptom, or why nothing matched
|
||||
- `considered`: the issue numbers you actually read
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["duplicate_of", "confidence", "evidence", "considered"],
|
||||
"required": ["duplicate_of", "confidence", "evidence"],
|
||||
"properties": {
|
||||
"duplicate_of": {
|
||||
"type": ["integer", "null"],
|
||||
|
|
@ -15,10 +15,6 @@
|
|||
"evidence": {
|
||||
"type": "string",
|
||||
"description": "One sentence naming the shared root cause and symptom, or why nothing matched."
|
||||
},
|
||||
"considered": {
|
||||
"type": "array",
|
||||
"items": { "type": "integer" }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,10 +31,15 @@ const config: FlagConfig = { repo: "BerriAI/litellm", issueNumber: 35, dryRun: f
|
|||
|
||||
describe("parseVerdict", () => {
|
||||
test("accepts the schema's shape, with a null duplicate_of", () => {
|
||||
const parsed = parseVerdict('{"duplicate_of": null, "confidence": 0.9, "evidence": "Nothing matches.", "considered": [1]}');
|
||||
const parsed = parseVerdict('{"duplicate_of": null, "confidence": 0.9, "evidence": "Nothing matches."}');
|
||||
expect(parsed).toEqual({ kind: "verdict", verdict: { duplicate_of: null, confidence: 0.9, evidence: "Nothing matches." } });
|
||||
});
|
||||
|
||||
test("keeps only the three fields the flag step uses, whatever else Codex sends", () => {
|
||||
const parsed = parseVerdict('{"duplicate_of": 12, "confidence": 0.99, "evidence": "Same traceback.", "considered": [12, 34]}');
|
||||
expect(parsed).toEqual({ kind: "verdict", verdict: { duplicate_of: 12, confidence: 0.99, evidence: "Same traceback." } });
|
||||
});
|
||||
|
||||
test("rejects non-JSON, a non-object, a non-integer target, a missing confidence and empty evidence", () => {
|
||||
expect(parseVerdict("not json").kind).toBe("skip");
|
||||
expect(parseVerdict('"just a string"').kind).toBe("skip");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue