Skip to content

Stop recipe_update reporting photos and topics as lost - #501

Merged
sysread merged 1 commit into
mainfrom
claude/recipe-editor-empty-lists-uhm8kt
Aug 17, 2026
Merged

Stop recipe_update reporting photos and topics as lost#501
sysread merged 1 commit into
mainfrom
claude/recipe-editor-empty-lists-uhm8kt

Conversation

@sysread

@sysread sysread commented Aug 17, 2026

Copy link
Copy Markdown
Owner

SYNOPSIS

recipe_update answered every edit with an empty photo list and an
empty topic list. Neither was true. It now reads the photo set back
and drops the topics field.

PURPOSE

A recipe edit through the tool came back reporting zero photos and
zero topics
, so the model warned the user its edit had probably
dropped three photos and every tag. Nothing had been dropped - the
photos were still on the recipe, and the tags came back on their own 43
minutes later.

The cost is trust in the edit path. A tool that cries data-loss on a
clean write teaches the user to distrust every edit, and teaches the
model to hedge every confirmation.

DESCRIPTION

How it behaved. Two fields, two different failure modes.

  • photos - recipe_update never sets the photo set, so it passes
    p_set_image_ids: false and the RPC inherits the previous
    version's links onto the new version. The tool then returned
    photos: [] as a literal, never looking at what it had carried
    forward. A header comment justified this ("the recipe-photo
    manipulation tools aren't ported for v1") - the port landed, the
    comment didn't move.
  • topics - the clear_recipe_topics_on_change trigger empties
    the column on any content edit, which is how the recipe-topics
    curation unit knows to re-tag the row. The RPC's return query
    reads the row back after that trigger fires, so the field was
    structurally always [] on this path.

What changes.

  • photos - the tool reads the post-write link set back instead of
    asserting a shape. The "newest version's links" query moved out of
    recipe_get into _recipe_helpers.ts::readRecipePhotoMeta, so both
    tools answer photo questions from one read and can't drift.
  • topics - stripped from the echoed row. It's re-queue
    bookkeeping, not the recipe's tags, and the only number it can ever
    carry is a misleading zero. recipe_get is the read-back path once
    the unit has caught up.
  • schema - the tool description now says the response carries the
    recipe's current photo list and that this tool never edits it.
  • tests - tests/recipe_update.test.ts, 6x cases: photos reported +
    position-sorted, topics absent, empty and no-version-row branches,
    p_set_image_ids still false, and the empty-patch rejection.

How that closes it. The response now describes state the tool
actually read
, so a clean edit reads as a clean edit.

Notes for reviewers:

  • recipe_save's photos: [] is deliberately left alone. A create
    passes p_image_ids: null, so the recipe genuinely has no photos yet
    • that literal is honest, not the same bug.
  • Dropping topics from the response is an intentional shape
    change, not an oversight. Adding it back only re-arms the false alarm.
  • The topics wipe itself is correct behavior and is untouched here;
    only the reporting of it changed.
  • docs/dev/cookbook.md's file list pointed at src/lib/tools/recipe_*.ts,
    which have been schema-only since the function-side port, and at a
    notifyCookbookChanged() contract that no longer exists. Both
    corrected while in the area.
  • docs/user/cookbook.md gains the missing consequence: an edited
    recipe really does sit under untagged until the hourly sweep.

Generated by Claude Code

Editing a recipe through the tool answered with `photos: []` and a
`topics: []`, and the model read both as data loss - it told the user
its edit had probably dropped three photos and every topic tag. Neither
had been touched.

The photo list was a literal. recipe_update never sets the photo set, so
the RPC inherits the previous version's links onto the new version, and
the tool asserted an empty array instead of looking. It now reads the
post-write link set back the same way recipe_get does; the shared read
moved into _recipe_helpers.ts so the two answer photo questions
identically. The header comment justifying the shortcut ("the photo
tools aren't ported for v1") had outlived the port.

The topics array was true but meaningless. Any content edit fires the
re-queue trigger, which empties the column so the curation unit re-tags
the recipe, and the RPC reads the row back after that trigger runs - so
the field is always empty on this path, whatever the recipe was tagged
with a second earlier and will be tagged with again within the hour. It
is bookkeeping, not the recipe's tags, so the tool strips it rather than
echoing a number that can only mislead. recipe_save's `photos: []` is a
different case and stays honest: a create links no images.

The user doc gained the missing consequence - an edited recipe really
does sit under "untagged" until the worker's next sweep - and the dev
doc's file list, which pointed at browser-side tool paths that have been
schema-only since the function port, now points where the code is.
@sysread
sysread merged commit 2e5ba51 into main Aug 17, 2026
1 check passed
@sysread
sysread deleted the claude/recipe-editor-empty-lists-uhm8kt branch August 17, 2026 21:42
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.

2 participants