Skip to content

Allow callers to disable all tools for a single Agent call #235

@fwang2002

Description

@fwang2002

Description

Problem

Callers cannot disable tool use for a single Generate / Stream call without going through a PrepareStep callback.

In prepareTools (agent.go:987-1024):

for _, tool := range tools {
    if len(activeTools) > 0 && !slices.Contains(activeTools, tool.Info().Name) {
        continue
    }
    ...
}

ActiveTools == nil and ActiveTools == []string{} both mean "include every tool"this is documented by the test Empty ActiveTools means all tools (agent_test.go:1333). So there is no value of ActiveTools that means
"no tools for this call".

The only existing way to remove all tools for a step is PrepareStepResult.DisableAllTools, which is only reachable from inside a PrepareStep callback. A caller who simply wants to ask the model a tool-free follow-up
question on an already-configured agent has to write a PrepareStep function just to flip a bool.

## Proposal

Add DisableAllTools bool to AgentCall and AgentStreamCall, mirroring the existing PrepareStepResult.DisableAllTools field.

Metadata

Metadata

Assignees

No one assigned
    No fields configured for feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions