Skip to content

fix(scoring): treat a null scores list as a reply with no entries - #154

Merged
musingfox merged 1 commit into
mainfrom
fix/scoring-null-scores
Nov 3, 2026
Merged

musingfox merged 1 commit into
mainfrom
fix/scoring-null-scores

Conversation

@musingfox

Copy link
Copy Markdown
Owner

Why

A scoring reply of {"scores": null} raised TypeError at src/cyris/service_layer/scoring.py:96. score_in_batches caught it, so the run went on, but it logged a stack trace and marked the run degraded instead of the "Scored none of N articles: the reply had 0 entries" warning that PR #128 added. Raised in the PR #128 review; no model has been seen sending null.

What

  • data.get("scores") or [] gives null the same path as a missing key.
  • tests/test_scoring.py adds a null scores case to test_a_batch_scoring_nothing_warns. It was red (TypeError) before the fix.

Verification

  • scripts/check.sh: 4852 passed.
  • This is also the first code change to land through the push-to-main deploy (ADR 0024).

🤖 Generated with Claude Code

A reply of {"scores": null} made `for entry in entries` raise TypeError,
so score_in_batches logged a stack trace and marked the run degraded
instead of the "Scored none of N articles: the reply had 0 entries"
warning PR #128 added for a reply with no scores. `or []` gives null
the same path as a missing key. No model has been seen sending null;
the case came from the PR #128 review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@musingfox

Copy link
Copy Markdown
Owner Author

@codex review

@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T13:58:11.251517Z 707c4f7 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude

claude Bot commented Nov 3, 2026

Copy link
Copy Markdown

Reviewed the diff. data.get("scores") or [] correctly handles a null scores value. The warning path (len(entries)) still works, and the new null scores test case covers it. I found nothing worth raising.

🤖 Generated with Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 707c4f7434

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@musingfox
musingfox merged commit 750d3d5 into main Nov 3, 2026
3 checks passed
@musingfox
musingfox deleted the fix/scoring-null-scores branch November 3, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant