charmbracelet / charmbracelet/fantasy
Allow callers to disable all tools for a single Agent call
- Dominant language
- Go
- Stars
- 987
- Forks
- 137
- Avg merge
- 14h 41m
- Merged PRs (30d)
- 12
Description
### 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):
```go
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.
Contributor guide
Research direction
Start with AgentCall and AgentStreamCall, then read prepareTools in agent.go:987-1024 and the existing PrepareStepResult.DisableAllTools behavior. Review the Empty ActiveTools means all tools test in agent_test.go:1333. Done means either call type can request no tools for one Generate or Stream call without a PrepareStep callback, with tests covering that behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100