When to challenge AI's suggestion
During a code review at GreenGrid, you ask AI to review a teammate's pull request. The PR adds a function that retries failed sensor API calls with exponential backoff. AI suggests the following improvement:
"The retry logic uses a
forloop withtime.sleep(). Consider replacing this with thetenacitylibrary, which provides decorators for retry logic with configurable backoff strategies. This would reduce the function from 15 lines to 3 lines and is more maintainable."
The suggestion is technically sound. However, GreenGrid's deployment pipeline has strict dependency approval policies, and tenacity is not on the approved list.
What is the best next step in your iterative collaboration with AI?
This exercise is part of the course
Advanced AI-Assisted Coding for Developers
Hands-on interactive exercise
Turn theory into action with one of our interactive exercises
Start Exercise