Skip to content

fix: guard against ambiguous food write retries - #39

Merged
milldr merged 1 commit into
mainfrom
tembo/prevent-ambiguous-write-retries
Sep 9, 2026
Merged

milldr merged 1 commit into
mainfrom
tembo/prevent-ambiguous-write-retries

Conversation

@milldr

@milldr milldr commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Disable automatic browser SDK transport retries so a lost response cannot silently replay a non-idempotent operation.
  • Warn before quick-add that progress or a tool timeout is not failure; report write errors as unconfirmed and require checking all macro rows before any retry.
  • Return explicit [] for valid empty servings JSON, reject missing export headers, and send machine-mode export errors to stderr with a nonzero exit status.
  • Document baseline comparison, process/session polling, and partial-write handling.

Incident analysis

The earlier agent launched quick-add twice after receiving only 30 seconds of progress output. Its execution wrapper returned only output and discarded process/session metadata. It inspected the diary before establishing that the original write had finished, then incorrectly treated absence as a completed failure. The user confirmed both writes ultimately saved. This primarily requires an agent/prompt fix; SDK retries and ambiguous empty export output are additional code-level risks, not proven causes of this incident. Companion Promptr branch: tembo/safe-crono-verification.

Validation

  • 243 tests pass, including pending-write, ambiguous failure, SDK retry configuration, quick-add row parsing, and empty/invalid export regressions.
  • npm run build and npm run lint pass.
  • Changed TypeScript files pass Prettier; git diff --check passes.
  • Tests run with KERNEL_API_KEY, CRONO_CRONOMETER_USERNAME, and CRONO_CRONOMETER_PASSWORD unset to isolate credential fixtures from the sandbox environment.
  • No live food writes or diary edits performed.

Want tembo to make any changes? Add a comment with @tembo and i'll get back to work!

View on Tembo  Review in Tembo  View Agent Settings

Co-authored-by: Dan <miller0daniel@gmail.com>
@tembo tembo Bot added the tembo Pull request created by Tembo label Sep 9, 2026
@milldr
milldr merged commit de1c28c into main Sep 9, 2026
3 checks passed
@milldr
milldr deleted the tembo/prevent-ambiguous-write-retries branch September 9, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tembo Pull request created by Tembo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant