Repository navigation
fix(omi-hacker-news-app): guard non-dict payloads, validate item_id, and safe limit bounds (#14283) - #14284
Conversation
…and safely format missing objectID
… limits, and item_id validation
…ins/omi-hacker-news-app/main.py
|
Thanks @PINYOPATTANAWASANPORN - this is a tidy hardening pass that addresses all four failure modes from #14283, with hermetic regression tests to match. Reviewed both changed files: plugins/omi-hacker-news-app/main.py
plugins/omi-hacker-news-app/test_main.py
Also confirmed the linked issue #14283 describes exactly these four defects, the tool manifest schema ( Feedback generated by automated maintainer tooling on behalf of the Omi maintainers. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
Git-on-my-level
left a comment
There was a problem hiding this comment.
Obvious bugfix with tests; CI green on this head. Approving for admin squash.
Summary of Changes
_safe_payload()to prevent unhandledAttributeError: 'NoneType' object has no attribute 'get'when requests arrive withnullor non-dict payloads._safe_limit()to disallow boolean inputs and safely clamp integer limits between1andMAX_LIMIT.get_discussionto validateitem_id: rejectsNone, booleans, empty strings, and non-positive numbers with clear validation error messages before calling downstream API._format_storyURL construction to prevent renderingitem?id=NonewhenobjectIDis omitted.test_main.pycovering all new guard paths.Fixes #14283
Failure-Class: none