Skip to content

Add update_food_entry tool (#76, updated for account diary groups) - #96

Merged
rwestergren merged 4 commits into
rwestergren:mainfrom
jorgebaptista:update-food-entry-on-main
Nov 25, 2026
Merged

rwestergren merged 4 commits into
rwestergren:mainfrom
jorgebaptista:update-food-entry-on-main

Conversation

@jorgebaptista

@jorgebaptista jorgebaptista commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Brings #76 (update_food_entry, by @paultristanwagner) up to date with current main, as requested in #76. The original commit is kept, so authorship is preserved.

Conflict: #88/#92 replaced the hard-coded _DIARY_GROUPS map with account-specific diary groups.

Resolution:

  • update_food_entry resolves diary_group with client.resolve_diary_group, matching names the same way add_food_entry does. 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.
  • The tool echoes the target group like add_food_entry.
  • update_serving accepts any 16-bit group number (the high bits of order) instead of 1-4.

Tests:

  • New server-level tests cover moving to a named custom group and refusing "auto" without editing.
  • The client validation test now checks the 0-65535 range.
  • ruff check, ruff format --check and pytest all 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.

paultristanwagner and others added 3 commits October 16, 2026 11:24
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
Resolve the conflict with #88/#92: update_food_entry now resolves
diary_group through client.resolve_diary_group, rejects "auto" for a move,
and echoes the target group like add_food_entry.
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
rwestergren merged commit 3da5d9e into rwestergren:main Nov 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants