Repository navigation
Conversation
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for this hardening pass — the direction is right: removing str(e) and raw input echoes from the date-parsing error handlers in backend/utils/retrieval/tools/action_item_tools.py is a real security improvement, and I verified the new static returns (start_date, end_date, due_start_date, due_end_date, plus the due_at handlers in the create and update tools) all fire before any DB call. Two mechanical issues are blocking CI, both easy fixes.
1. The new tests fail — they patch an attribute that doesn't exist
backend/tests/unit/test_action_item_date_params_sanitization.py: both tests do patch("utils.retrieval.tools.action_item_tools.get_user_timezone", ...), but action_item_tools has no get_user_timezone import — timezone rendering goes through resolve_display_tz from utils.conversations.render, and it's only consulted after date parsing. CI confirms: Backend unit shard 3/4 fails with AttributeError: <module 'utils.retrieval.tools.action_item_tools'> does not have the attribute 'get_user_timezone'.
The good news: the mock isn't needed at all. The invalid-date early returns happen before any timezone lookup or database access, so you can drop the patch(...) wrapper and call the tools directly — the tests should then pass hermetically.
2. Hygiene: Failure-Class declaration isn't recognized
The PR body has `Failure-Class: none` inside a bullet with backticks, and the failure-class-protocol preflight only accepts the plain form. Please add a standalone line to the PR description:
Failure-Class: none
The Backend Hermetic Merge Gate failure is downstream of these two (it fails closed), so fixing both should turn the required checks green.
One non-blocking observation: the adjacent "must include timezone" branches (e.g. start_date at line 216, end_date at line 226, due_at in create_action_item_tool at line 447) still echo the raw caller-supplied value (: {start_date}). That's user input rather than exception data, so it's a lesser concern — but if the goal (per the summary) is to stop unvalidated input echoes entirely, those branches are worth a follow-up pass.
Once the test patch target is fixed and the Failure-Class line is plain text, this should be in good shape.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
|
Closing as a later copy of #19661. The earlier pull request is the one to keep. |
|
Hey @Mateidslx 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |
Summary
Hardens
get_action_items_tool,create_action_item_tool, andupdate_action_item_toolinbackend/utils/retrieval/tools/action_item_tools.pyby removing rawstr(e)exception leakage and unvalidated input echoes from date parsing error handlers.Changes
backend/utils/retrieval/tools/action_item_tools.py:start_date,end_date,due_start_date,due_end_date, anddue_atformat errors return clean strings without leakingstr(e).backend/tests/unit/test_action_item_date_params_sanitization.pyverifying that invalid inputs return clean messages without leaking internal sentinel strings.Verification
Failure-Class: none