Ship it · Project 1
Make it
ship: gateway.py
Fix the real file until every test passes. The tests run in your browser, so nothing you type leaves this page.
Project 1 · Resilient Gateway
Northwind's risk report calls the LLM gateway through this client. On a bad day it freezes, loops forever and double-sends work. Fix it until every test passes. Everything you need is in the five parts you built.
0 of 5 parts built. The tests check the same ideas.
What the tests check
- ·Returns the answer on a 200
- ·Every call sets a timeout
- ·Retries after a timeout
- ·Retries a 429 and waits as long as Retry-After says
- ·Never retries a 400 or a 401
- ·Gives up after max_attempts
- ·Reuses one idempotency key across retries
- ·Logs one searchable line when it gives up
gateway.py
First load takes a few seconds.