Repository navigation
Add update_food_entry tool (#76, updated for account diary groups) - #96
Merged
rwestergren merged 4 commits intoNov 25, 2026
Merged
Conversation
The app changes a serving's amount with /api/v2/edit_serving, re-sending the whole serving. The meal group lives in the high bits of `order`, and edit_serving accepts a new order too, so one call changes the amount, the measure and the meal. Claude-Session: https://claude.ai/code/session_01MCJFDo71qoSqTRtcGfkpXJ
update_serving limited diary_group to 1-4, the old default layout. Groups now come from resolve_diary_group, so any enabled group is valid (for example a custom group 5). Add server-level tests for moving to a named custom group and for rejecting "auto".
Reject gram-weight edits for serving-based recipes, whose API amounts are reference-serving counts. Keep measure and group edits available and document the restriction. Lock each serving's full fetch-modify-save cycle so concurrent partial edits preserve each other's changes. Cover both fixes with regression tests.
rwestergren
approved these changes
Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings #76 (
update_food_entry, by @paultristanwagner) up to date with currentmain, as requested in #76. The original commit is kept, so authorship is preserved.Conflict: #88/#92 replaced the hard-coded
_DIARY_GROUPSmap with account-specific diary groups.Resolution:
update_food_entryresolvesdiary_groupwithclient.resolve_diary_group, matching names the same wayadd_food_entrydoes. Custom groups therefore work, such as a group named "Night", number 5."auto"is rejected for a move, since there is no time of day to pick from.add_food_entry.update_servingaccepts any 16-bit group number (the high bits oforder) instead of 1-4.Tests:
"auto"without editing.ruff check,ruff format --checkandpytestall pass: 523 tests.I have this change installed locally on top of v0.2.7. The live API checks are the ones from #76: amount, meal, and both at once.
Supersedes #76.