Add pantry-pro: voice pantry inventory, expiry alerts, and meal ideas from stock - #368
Conversation
… from stock Co-authored-by: Cursor <cursoragent@cursor.com>
✅ Community PR Path Check — PassedAll changed files are inside the |
🔀 Branch Merge CheckPR direction: ✅ Passed — |
✅ Ability Validation Passed |
🔍 Lint Results✅
|
There was a problem hiding this comment.
Hey @ileana-pr , hope you're doing great. Nice work on this, the daemon contract is spot on and the delete-then-write storage is exactly right.
Two things:
In main.py, _load() treats "no file yet" and "couldn't read the file" the same, and since _save() deletes before writing, one failed read means the next "add milk" writes an empty pantry over the user's real inventory. Worth returning a success flag from _load() and having _save() refuse to write without it.
_find_item() matches both directions, so adding "almond milk" increments the existing "milk" instead of tracking it separately and "I used the almond milk" then deletes your milk. I'd make merging strict (exact, or singular/plural) and keep the fuzzy match only for lookups.
One nice improvement: the recipe prompt only uses inventory, but the platform already knows the user read_file("user_profile.md", in_ability_directory=False) gives you diet and household size. Read only, never write; more in docs/Agent-Memory-and-Context-Injection.md.
Thanks for this, nice work.
|
Thanks for the review — addressed all three notes in the latest commit:
|
|
Follow-up PR with the three review fixes (load/save safety, strict item matching, |
does_match() hardcoded a HOTWORDS tuple that duplicated whatever gets configured as this ability's dashboard trigger words -- a second source of truth that can drift from the first with nothing to notice if it does. No other ability in the repo overrides does_match() for this reason; invocation is left entirely to the dashboard. Unlike a couple of other abilities reviewed this same pass, HOTWORDS had no second job here (e.g. no in-conversation restart check reusing it), so removing it needed nothing else adjusted. Verified the three fixes this PR actually addresses are unaffected: strict add-time matching still keeps "almond milk" distinct from "milk", fuzzy lookup still resolves "eggs" to a stocked "egg", and the new item_date / full_list logic added in this PR still runs correctly. File still imports cleanly with no does_match anywhere in the class. Separately, and NOT changed here: _search_meals/_lookup_meal call session_tasks.get_async(), a method name that appears nowhere in the SDK reference docs (only .create() and .sleep() are documented there) and that no other ability in this repo uses -- everything else calls session_tasks.get() or plain requests.get(). That code isn't touched by this PR's diff at all; it's inherited from openhome-dev#368. Flagging it rather than guessing at a fix, since getting a live SDK method name wrong by assumption risks trading a real bug for a different one.
🆕 New Community Ability
Ability Name:
community/pantry-proWhat does it do?
Voice-guided pantry assistant for OpenHome. Tracks pantry and fridge inventory across sessions, suggests meals from what's already in stock (oldest food first), alerts before items expire, and builds a shopping list from used-up items and missing recipe ingredients.
Example conversation
User: "pantry pro"
OpenHome: "You have pasta, tomato sauce, and canned beans. Want recipe ideas?"
User: "yes"
OpenHome: "Using tomato sauce before it goes. I can do 1, Pasta and Beans. 2, Tomato and Herb Pasta. 3, Bean chilli. Pick a number, or say skip."
User: "1"
OpenHome: "Pasta and Beans. You're missing onion and garlic. Add those to the shopping list?"
APIs Required
None. Recipes use the free TheMealDB API (no key), with an LLM fallback if the request fails.
Checklist
main.pyextendsMatchingCapabilitywithregister_capabilityREADME.mdexists with description + setup instructionscommunity/pantry-pro/Summary
pantrypro_inventory.jsonTest plan
pantry proon an empty pantry and add a few items with dateswhat's in the fridge/what's expiringwhat can I cookand pick a recipe; confirm missing items can go on the shopping listwe're out of milkand confirm restock offerdonereturns to the Agent (resume_normal_flow)Made with Cursor