Skip to content

Answer on an OpenAI key from the Agno Bot, not only on Anthropic or an endpoint - #609

Merged
davidmckayv merged 1 commit into
CopilotKit:mainfrom
kevin9327:agno-openai-key-drop-params
Sep 19, 2026
Merged

davidmckayv merged 1 commit into
CopilotKit:mainfrom
kevin9327:agno-openai-key-drop-params

Conversation

@kevin9327

Copy link
Copy Markdown
Contributor

What this changes

Picked with an OpenAI key, the Agno Bot fails every run before a request leaves the container.

Agno's LiteLLM model sends temperature=0.7 and top_p=1.0 with every request (agno/models/litellm/chat.py, get_request_params). LiteLLM refuses both for a reasoning model, and gpt-5.5 is one. It is also what the harness gets on that choice: the desktop removes BOT_MODEL for an OpenAI key, so Compose passes its default, gpt-5.5. The run then ends in:

litellm.UnsupportedParamsError: gpt-5.5 only supports logprobs, top_p, top_logprobs when reasoning_effort resolves to 'none', ...

With only the temperature, LiteLLM refuses that too (gpt-5.5 doesn't support temperature=0.7 while reasoning is active).

The model is now built with request_params={"drop_params": True}, set on this one client only, so LiteLLM drops a parameter the model does not take instead of refusing the run. #533 fixed the LlamaIndex Bot the same way, for the temperature LlamaIndex sends. Measured against the fake provider below, the request for gpt-5.5 now carries neither parameter. A compatible endpoint's local-model still gets both, because LiteLLM does not know that model and drops nothing.

Left alone: the Anthropic key and OpenAI-compatible endpoint choices already worked, and every other harness.

Where it runs

  • New state that outlives a request? None. One keyword argument on the model the module builds at import.
  • What happens on the second replica? The same. Each harness process builds the same client from the same environment.
  • Anything serialised? No.
  • Anything fanned out to a browser? No.
  • New listener, port, or schedule? No. The CI step added here runs beside the three harness suites already in python-harness.

Boundary and audit

  • Every acting call still goes through the gateway: nothing on the server changes, and the harness still refuses a request without the server's token.
  • New refusals and new failures each write a row: no new refusal. What gets wider: a parameter the model rejects is now dropped without a word instead of failing the run, the same trade Reach the model the setup screen chose from the LlamaIndex Bot, not only an OpenAI one #533 made for LlamaIndex.
  • Nothing new is trusted from the client.

Changelog

  • A line in CHANGELOG.md under Unreleased.

Proof

  • New agent-agno/tests/test_main.py follows agent-llamaindex/tests/test_main.py. It starts a local fake provider serving /v1/chat/completions and /v1/messages, imports the harness under the environment the desktop writes for each of the three choices, and posts an AG-UI run to /agui. It asserts HTTP 200, RUN_FINISHED, no RUN_ERROR, and that the provider got the chosen model on the chosen route.
  • Linux (ubuntu-latest, Python 3.12, a throwaway workflow on my fork running the same commands as the new CI step). This branch: 3 passed. With agent-agno/src checked out from main (2d09a08): 1 failed, 2 passed. The failure is [an OpenAI key], with the UnsupportedParamsError above in the stream.
  • Windows, Python 3.12: the same results.
  • Versions: agno 3.0.10, litellm 1.101.0.
  • Not run: a real OpenAI or Anthropic key, and the published image.

This adds a step at the end of python-harness and an entry at the top of Unreleased, the same places other open PRs touch. If one of them lands first this will need a rebase, and I'll do it.

🤖 Generated with Claude Code

…n endpoint

Agno's LiteLLM model sends `temperature=0.7` and `top_p=1.0` with every request. LiteLLM refuses
both for a reasoning model, and `gpt-5.5` is one: it is the model Compose passes to the harness when
the setup screen names none, which is what the OpenAI key choice does. So with an OpenAI key every
run of the Agno Bot ended in `UnsupportedParamsError` before a request left the container.

The model is now built with `drop_params`, scoped to this one client, so a parameter the model does
not take is dropped instead of refused. That is how the LlamaIndex Bot already handles the
temperature LlamaIndex sends, for the same reason. A model that takes both, such as the one behind
an OpenAI-compatible endpoint, still receives them.

The new test follows the LlamaIndex Bot's: a local fake provider, the environment the desktop
writes for each of the three choices, and an AG-UI run through `/agui`. Before this change the
OpenAI key choice fails and the other two pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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