Skip to content

[Bounty Proposal] fix(memories): sanitize internal exception detail in batch-delete 413 response ($25 proposed) #19519

Closed

Description

@1132dadf

Summary

This issue proposes a $25 bounty for sanitizing the last raw exception reflection left in backend/utils/memory/memory_service.py.

Problem statement

MemoryService.delete_batch() (backing DELETE /v3/memories/batch) maps an over-limit canonical batch to:

raise HTTPException(status_code=413, detail=str(exc)) from exc

This is the only non-static detail among the file's ~120 HTTPException raises, and it returns the data layer's internal reason verbatim to the API client — e.g.:

canonical memory {memory_id} alone exceeds Firestore's 500-mutation transaction limit

The response therefore discloses internal memory identifiers and internal data-layer (Firestore) transaction-limit details that are not part of any released contract. Every neighbouring mapping (402/404/503/…) already answers with a static message; this one is a leftover from the sanitization campaign.

Solution & PR

The PR replaces the raw reflection with a static detail (Memory batch exceeds the supported size limit), keeps the released 413 status unchanged, preserves the internal reason server-side (masked via utils.log_sanitizer.sanitize + exc_info=True logging; still chained as the exception cause), and adds a hermetic unit test asserting the response detail and the log line carry no internal markers.

Payout

Activity

  1. 1132dadf commented on Sep 28, 2026

    @1132dadf
    ContributorAuthor

    Implemented in #19520: the 413 status stays as released, the detail is now a static message, the internal reason is logged server-side (sanitized, with exc_info=True) and stays chained as the cause, and a hermetic regression test covers the leak.

  2. 1132dadf commented on Sep 28, 2026

    @1132dadf
    ContributorAuthor

    Merged as #19520 — claiming the US$25 bounty for this item (sanitize internal exception detail in batch-delete 413 responses). Thank you!

  3. aryanorastar commented on Sep 29, 2026

    @aryanorastar
    Collaborator

    Fixed on main by #19520 (938141a). The batch-delete 413 detail is a static message in backend/utils/memory/memory_service.py.

  4. 1132dadf commented on Oct 22, 2026

    @1132dadf
    ContributorAuthor

    Hi team. A factual payment query about this proposal, not a comment on the code.

    PR #19520 was merged on 28 September: #19520 . @aryanorastar confirmed the fix on main (938141a) and closed this proposal as completed on 29 September.

    I filed this proposal. I claimed payment in this thread on 28 September, and I emailed [email protected] with the proposal link and my PayPal account, following the "Claiming payment" step in the contribution guide: https://docs.omi.me/doc/developer/Contribution .

    As of today, 22 October, I have not received a reply from a basedhardware.com address.

    I saw that the open bounty proposals were closed on 22 October with a note that bounties are paused for now. If that pause is intended to apply retroactively to work that was already merged and already closed as completed, a one-line confirmation would let me close this out. Otherwise, could I get an update on the timeline for the US$60 outstanding across #19519, #20401 and #18904?

    Thanks for the work you all put into this project.

  5. 1132dadf commented on Oct 23, 2026

    @1132dadf
    ContributorAuthor

    Hi
    Thanks again for reviewing and merging my PR.
    Just a quick note regarding the payment/sponsorship: The previous PayPal account I provided was a Mainland China region account, which unfortunately has strict cross-border restrictions and cannot receive international personal transactions.
    To make it easier for you, I have set up a new payment link via Ko-fi. You can now complete the payment using your Credit Card or an international PayPal account at:
    👉 https://ko-fi.com/fengyuan_cn
    Please kindly process the transfer from this new link. Let me know if you encounter any issues during the checkout.
    Thanks for your support and time!
    Best regards
    FengYuan
    If you prefer other payment methods, please let me know and we can figure it out.God bless you for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions