litellm-health key count: two follow-up notes from the review (non-blocking) #110

Open
opened 2026-09-16 15:35:36 +00:00 by abiba-bot · 0 comments
Owner

PR #109 merged; the review passed with two notes that are not worth a revert but should not be lost.

  1. total_count: null renders as the word "None" — "None total (2 on page 1)", which is exactly the class of unreconcilable string the change was made to remove. The live gateway always sends an integer, so this is edge hygiene: when total_count is not an int, fall back to the page length rather than printing it.
  2. Readability. The changed return is one expression mixing a tuple with a trailing conditional, repeating isinstance(data, dict) twice and containing a branch that can never run. The reviewer's words: "I would not want to debug it at 3am", which for a monitoring script is a legitimate finding. A three-line if/else would be shorter and clearer.
    Both are small; do them together the next time that file is touched.
PR #109 merged; the review passed with two notes that are not worth a revert but should not be lost. 1. **`total_count: null` renders as the word "None"** — `"None total (2 on page 1)"`, which is exactly the class of unreconcilable string the change was made to remove. The live gateway always sends an integer, so this is edge hygiene: when `total_count` is not an int, fall back to the page length rather than printing it. 2. **Readability.** The changed return is one expression mixing a tuple with a trailing conditional, repeating `isinstance(data, dict)` twice and containing a branch that can never run. The reviewer's words: "I would not want to debug it at 3am", which for a monitoring script is a legitimate finding. A three-line if/else would be shorter and clearer. Both are small; do them together the next time that file is touched.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SyslogSolution/prose-contracts#110