Skip to content

Restrict AI menu parsing retries to transient AI exceptions only - #88

Draft
kon-mtal with Copilot wants to merge 3 commits into
AIretryfrom
copilot/sub-pr-79
Draft

Restrict AI menu parsing retries to transient AI exceptions only#88
kon-mtal with Copilot wants to merge 3 commits into
AIretryfrom
copilot/sub-pr-79

Conversation

Copilot AI commented May 10, 2026

Copy link
Copy Markdown

This PR addresses review feedback on overly broad retry behavior in ProdAIService. Retries are now limited to transient AI client failures so deterministic mapping/persistence failures fail fast instead of being retried.

  • Retry scope narrowed to transient AI failures

    • Updated @Retryable on parseMenuFromImage to retry only TransientAiException.
    • Removes retries for non-transient paths (e.g., enum mapping, validation, DB persistence), reducing hidden failure amplification.
  • Retry infrastructure made explicit

    • Added explicit dependencies required for retry proxying:
      • spring-boot-starter-aop
      • spring-retry
  • Guardrail test for retry contract

    • Added ProdAIServiceRetryConfigTest to lock the retry annotation contract:
      • retryFor = TransientAiException.class
      • maxAttempts = 5
      • backoff(delay = 1000, multiplier = 2.0)

Example of the updated retry contract:

@Retryable(
    retryFor = TransientAiException.class,
    maxAttempts = 5,
    backoff = @Backoff(delay = 1000, multiplier = 2)
)
public List<Dish> parseMenuFromImage(byte[] imageBytes) { ... }

Copilot AI commented May 10, 2026

Copy link
Copy Markdown
Author

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • archive.eclipse.org
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.11/a2d47e15/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.11/a2d47e15/bin/m2.conf -Dmaven.home=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.11/a2d47e15 -Dlibrary.jansi.path=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.11/a2d47e15/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/java-backend/java-backend org.codehaus.plexus.classworlds.launcher.Launcher spotless:check (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] [WIP] Address feedback on transient client exceptions in AIservice error handling Restrict AI menu parsing retries to transient AI exceptions only May 10, 2026
Copilot AI requested a review from kon-mtal May 10, 2026 19:13
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