Skip to content

fix: skip seed for Gemini when api_base has no trailing slash - #600

Merged
codelion merged 1 commit into
algorithmicsuperintelligence:mainfrom
fermibubble:skip-gemini-seed
Nov 15, 2026
Merged

codelion merged 1 commit into
algorithmicsuperintelligence:mainfrom
fermibubble:skip-gemini-seed

Conversation

@fermibubble

Copy link
Copy Markdown
Contributor

Gemini's OpenAI-compatible endpoint rejects seed (Invalid JSON payload received. Unknown name "seed", see #105), so OpenAILLM skips it there. The check compares api_base to the exact string https://generativelanguage.googleapis.com/v1beta/openai/, though, so the same URL without the trailing slash still sends seed. With the default random_seed: 42, every call then fails, and the log only says Error code: 400 because the OpenAI client can't read Gemini's error body. Against the live API with gemini-2.5-flash-lite:

  • api_base: ".../v1beta/openai/": works, seed skipped
  • api_base: ".../v1beta/openai": All 1 attempts failed with error: Error code: 400

Changes:

  • match on the host (generativelanguage.googleapis.com) instead of the exact URL
  • log the "Skipping seed parameter" warning once per model instead of before every request. A 40-iteration run printed it 40 times.

Tests: new tests/test_openai_seed.py, 2 of its 3 tests fail on main. Full suite (python -m unittest discover -s tests -p "test_*.py"): 1079 OK, 7 skipped.

Gemini's OpenAI-compatible endpoint rejects seed (Invalid JSON payload received. Unknown name "seed", see algorithmicsuperintelligence#105), so OpenAILLM skips it there. The check compared api_base to the exact URL with a trailing slash, so the same URL without one still sent seed, and with the default random_seed every call failed with a bare "Error code: 400". Match on the host instead, and log the skip warning once per model rather than before every request.
@codelion
codelion merged commit a19bfce into algorithmicsuperintelligence:main Nov 15, 2026
5 checks passed
will-rice added a commit to will-rice/openevolve that referenced this pull request Nov 21, 2026
Upstream's fixes: a NaN combined_score ranks worst (algorithmicsuperintelligence#603), the evaluator's and
the novelty judge's LLM calls count in the token totals (algorithmicsuperintelligence#604), Mistral API
support (algorithmicsuperintelligence#602), responses cut off at max_tokens are reported (algorithmicsuperintelligence#599), nested
candidate definitions dedent (algorithmicsuperintelligence#601), llm.system_message is no longer dropped
(algorithmicsuperintelligence#598), Gemini seeding without a trailing slash (algorithmicsuperintelligence#600) and an R example fix (algorithmicsuperintelligence#597).

Two conflicts, both where the fork had moved upstream's code:
- llm/ensemble.py: upstream's per-call usage sum (_record_usage, take_usage)
  beside the fork's last_message and last_backend, both kept.
- process_parallel.py: the fork evaluates a child in _evaluate_child (generated
  and injected children alike); upstream's count of the evaluator's own LLM calls
  moves there, after the evaluation, into the result's and the metadata's usage.

The fork's suite fails the same 23 tests before and after the merge (upstream's
own, unrelated to it).

Claude-Session: https://claude.ai/code/session_01RnaESRvvoubZsW6wWrQAPQ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants