Skip to content

Remove agent_params from LLM operators so they cannot run tools - #74721

Merged
kaxil merged 1 commit into
mainfrom
commonai-llm-no-agent-params
Oct 14, 2026
Merged

kaxil merged 1 commit into
mainfrom
commonai-llm-no-agent-params

Conversation

@kaxil

@kaxil kaxil commented Oct 14, 2026

Copy link
Copy Markdown
Member

LLMOperator and the operators built on it (LLMBranchOperator, LLMSQLQueryOperator, LLMFileAnalysisOperator, LLMSchemaCompareOperator) are documented as one prompt in, one output back, with AgentOperator as the operator for a tool-call loop. Nothing enforced that. agent_params went straight to pydantic-ai's Agent(...), and both the LLMOperator docstring and operators/llm.rst listed tools as something to pass there. On main, LLMOperator(..., agent_params={"tools": [lookup_order]}) calls the tool and makes a second model request. That is an agent without what AgentOperator gives one: per-tool approval, durable replay, tool call logging, and connection templating for toolsets.

This removes agent_params from the LLM operators and their @task.llm* decorators, and adds two typed arguments for what a single call needs:

  • model_settings: pydantic-ai ModelSettings such as temperature or max_tokens, templated as agent_params was.
  • output_retries: how many times the model is asked again when its output fails validation. It is passed as pydantic-ai's integer retries, so it behaves like the old agent_params={"retries": n}.

Every LLM operator now builds its agent through LLMOperator._create_agent, which forwards only those two, so no function tool, toolset or capability can be registered. AgentOperator and @task.agent keep agent_params.

model_settings cannot add your tools, but one provider setting turns on a provider-hosted tool. The generic tool keys (tool_choice, parallel_tool_calls) only choose among tools the agent already has. OpenAI's openai_native_tools enables web search or file search, which OpenAI runs on its side; nothing executes in the task. The docs say this rather than the operator rejecting the key, because a list of rejected provider keys would go stale as providers add settings.

This is a Common AI 1.0 change, so there is no deprecation period: passing agent_params to an LLM operator now fails when the Dag is parsed. The changelog and operators/llm.rst carry the mapping:

Before After
agent_params={"model_settings": {...}} model_settings={...}
agent_params={"retries": n} output_retries=n
tools, toolsets, capabilities or spec_file in agent_params AgentOperator or @task.agent

LLMOperator and the operators built on it pass agent_params straight to
pydantic-ai's Agent, so tools, toolsets or capabilities turned a single
model call into an agent loop without AgentOperator's tool approval,
durable replay or tool logging. Replace agent_params with typed
model_settings and output_retries arguments; AgentOperator keeps
agent_params.
@kaxil
kaxil merged commit 7993ee1 into main Oct 14, 2026
85 checks passed
@kaxil
kaxil deleted the commonai-llm-no-agent-params branch October 14, 2026 11:39
@med9110

med9110 commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Hi @potiuk, I'd like to independently verify #74721 against common.ai 1.0.0rc1.
I'll test that LLM operators cannot execute agent tools, verify the new model settings and retry arguments, and confirm that AgentOperator remains unaffected.
I noticed the item is still unchecked in #74741. Would this focused verification be useful?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants