Fix nutrition service 404 errors and improve agent error handling #182
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Investigation revealed 13.9% error rate (5,884 404 errors out of 42,261 requests) in the nutrition service due to incomplete pet type catalog coverage. The agent was making requests for pet types not in the database, causing legitimate 404 responses and poor user experience.
Solution
This PR implements the recommended fixes from the investigation:
1. Expand Pet Type Catalog (
pet-nutrition-service/db-seed.js)2. Improve Agent Error Handling (
pet_clinic_ai_agents/nutrition_agent/nutrition_agent.py)Impact
Testing
Fixes the nutrition service issues identified in the investigation.