zz_

93850628 ยท zzmq.dev@gmail.com/zz

Commit

938506283ed6194002c81f2d33a68987d0ec73d3

Gemini backend: fix tool-call round-tripping, add retry-with-backoff, correct default model Verified end-to-end against a real Gemini API key, three real bugs found and fixed: 1. gemini-2.0-flash (the original default) is retired; gemini-2.5-flash is "no longer available to new users" either. gemini-3.8-flash is what Google's own error message steers new keys toward, and the one confirmed working -- now the default. 2. A real 400 from the API: "Function call is missing a thought_signature in functionCall parts." Gemini's response attaches an opaque thoughtSignature to each functionCall, and rejects a reconstructed one that's missing it on the next turn. Added a generic `raw` passthrough field to ChatMessage's tool_calls (ignored by Ollama, used by Gemini to replay the exact functionCall part it originally returned instead of reconstructing one). 3. An uncaught error from the backend used to crash the entire zz work process, not just the current attempt -- real risk for a remote API (confirmed: 503 "high demand" and 429 rate-limit errors, both transient). agent/loop.ts now retries a backend failure up to 3 times with backoff (3s/8s/15s) before giving up on just that one attempt, verified with a mocked always-failing backend (doesn't crash, returns finished:false cleanly). Confirmed end-to-end against the real API: a claimed ask's first turn actually succeeded (a real ask_claim executed in 2.6s -- faster than any Ollama turn this session). The free tier's 5 requests/minute quota for this model is the real limiting factor for continuous use, not a code issue -- each retry during testing consumed more of that same tiny budget. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

Troy Howard <thoward37@gmail.com> -- 2026-10-11T03:20:40.000Z

Tree at this commit