omi icon indicating copy to clipboard operation
omi copied to clipboard

[Bounty proposal] fix(iq_rating): unguarded OpenAI choices indexing and context_snippets coercion ($25 proposed)

Open t3ratech opened this issue 2 months ago • 2 comments

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_snippets to a list before slicing; stringify items before joining.
  • Add a hermetic, stdlib-only plugins/iq_rating/test_main.py regression suite covering empty choices, 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]

t3ratech avatar Sep 15 '26 08:09 t3ratech

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.

nazasnow avatar Sep 15 '26 15:09 nazasnow

Duplicate of #13966. Same iq_rating choices[0] / context_snippets crash as #13966 (already guarded on current main).

aryanorastar avatar Sep 20 '26 16:09 aryanorastar