Improve recipe import AI resilience #37

Merged
wantxapas merged 3 commits from codex/import-ai-resilience into main 2026-08-11 22:15:51 +01:00
wantxapas commented 2026-08-11 22:15:26 +01:00 (Migrated from github.com)

What changed

  • make recipe-import AI deadlines and attempt counts configurable
  • correlate AI logs with import session, stage, payload size, prompt size, timing, finish reason, and token usage
  • retry confirmed completion-length exhaustion once with a larger output budget
  • safely accept duration_seconds from editorial output while preserving strict validation
  • document the production configuration controls

Why

Some recipe editorial requests exceeded the previous transport deadline or exhausted the model completion budget. The importer also stopped when the model represented sub-minute durations in seconds even though the strict schema requested minutes.

Impact

Longer imports get one bounded attempt, confirmed truncated responses get one targeted larger-budget retry, and sub-minute durations are converted exactly to fractional minutes. Conflicting or otherwise unknown fields remain rejected.

Validation

  • go test ./... in backend
  • git diff --check
## What changed - make recipe-import AI deadlines and attempt counts configurable - correlate AI logs with import session, stage, payload size, prompt size, timing, finish reason, and token usage - retry confirmed completion-length exhaustion once with a larger output budget - safely accept `duration_seconds` from editorial output while preserving strict validation - document the production configuration controls ## Why Some recipe editorial requests exceeded the previous transport deadline or exhausted the model completion budget. The importer also stopped when the model represented sub-minute durations in seconds even though the strict schema requested minutes. ## Impact Longer imports get one bounded attempt, confirmed truncated responses get one targeted larger-budget retry, and sub-minute durations are converted exactly to fractional minutes. Conflicting or otherwise unknown fields remain rejected. ## Validation - `go test ./...` in `backend` - `git diff --check`
Sign in to join this conversation.
No description provided.