[Bounty proposal] fix(iq_rating): unguarded OpenAI choices indexing and context_snippets coercion ($25 proposed)
Proposal
Fix the crash reported in #13966 — plugins/iq_rating/main.py indexes
result["choices"][0]["message"]["content"] unguarded at two sites and
slices context_snippets without a list check, so a 200 with an empty
choices array (or a non-dict payload, or a non-list snippets value)
crashes the whole IQ-scoring run instead of degrading to the existing
fallbacks. Same defect class already fixed for public-holidays in #13928.
Scope
- Guard both
choices[0]extraction sites (empty/non-dict/non-list-safe). - Coerce
context_snippetsto a list before slicing; stringify items before joining. - Add a hermetic, stdlib-only
plugins/iq_rating/test_main.pyregression suite covering emptychoices, non-dict payloads, non-list snippets, and the unchanged happy paths. - Register the suite in
.github/checks-manifest.yaml(iq-rating-openai-guard-tests, local + ci).
$25 proposed. PR to follow implementing exactly this scope.
PayPal: [email removed]
Hi, I'd like to work on this issue. I will fix the unguarded indexing and context_snippets coercion in plugins/iq_rating/main.py.
Duplicate of #13966. Same iq_rating choices[0] / context_snippets crash as #13966 (already guarded on current main).