GEMINI CLIENT · STARTUP PREFLIGHT
Gemini integration: catch missing credentials before request
Validate credentials, backend settings and the model id at startup, or discover the same mistake through rejected calls.
Event trace
Computed data
Final metrics
Offline client model; no Google endpoint is contacted. Status labels are simplified: the exact HTTP code for a bad key differs by service, but in every case it is not retryable. The model allowlist is this fixture's deployment list, not the live model catalog. Backoff doubles per attempt without jitter.
A healthy client still meets rate limits
The client sends three requests one after another, each costing one Round trip of 400 ms. The opening configuration is healthy: API credential is Present and well formed, Run startup preflight is enabled and passes, and Rate-limited (429) responses is 1. The network-attempts table shows four calls: request 1 is throttled on its first attempt, waits the 500 ms Initial backoff, and succeeds on attempt 2 at 1,300 ms; requests 2 and 3 then succeed, and the run ends at 2,100 ms with one rejected call. Set Rate-limited (429) responses to 0 and the table shrinks to three calls finishing at 1,200 ms.
Fail at startup, not on the first request
Set API credential to Variable not set. With Run startup preflight enabled, the client checks its own configuration before sending anything: the credential must be present, non-empty and free of whitespace; the Vertex AI backend also needs a project and location; and the model id must be in this deployment's allowlist. Preflight now stops startup with one precise error, zero network calls and zero elapsed time, so the attempts table is empty by design. Now clear Run startup preflight: all three requests reach the network and each is rejected after 400 ms, a total of 1,200 ms and three rejected calls. A key error is not retryable, so retries do not help. Choose the gemini-2.5-flsh typo under Model id with preflight enabled and startup stops on the model id; with preflight cleared, the same typo produces three 404 responses instead.
Retries belong to transient errors
Return API credential to Present and well formed and set Rate-limited (429) responses to 2. Request 1 is throttled twice and retried after 500 ms and then 1,000 ms of backoff; its third attempt succeeds at 2,700 ms, and all three requests finish by 3,500 ms after five network calls. Raise the throttled count to 3 with Maximum retries per request at 2: request 1 exhausts its budget and fails, while requests 2 and 3 succeed. Initial backoff doubles on each retry, so raising it stretches every wait between attempts.
Backends and the remaining inputs
Backend switches between a Gemini Developer API key and a Vertex AI project. With Vertex, clear Project and location configured (Vertex only): preflight reports it at startup, and without preflight each request fails with a project or location error. Set but empty and Contains a pasted newline are both caught by preflight; whitespace in a key is a common copy-paste mistake. Requests to send changes how many calls a misconfiguration wastes. Play, Next event, Restart, Speed and Inspection time replay the attempts.
What is simplified
No Google endpoint is contacted and the model allowlist is a fixture, not the live model list. Real services return different status codes and messages for a bad key, and credentials can also expire or lack permission after startup, which a preflight cannot see. A useful preflight checks what is knowable locally and, optionally, makes one bounded probe call; it must never print the key.