Merge pull request #4371 from Stoic-Angel/feat-global-context

Add a global context for tool calls: tool_resources
This commit is contained in:
kompfner
2026-04-27 10:55:03 -04:00
committed by GitHub
5 changed files with 169 additions and 1 deletions

1
changelog/4371.added.md Normal file
View File

@@ -0,0 +1 @@
- Added `tool_resources` to `PipelineTask` and `FunctionCallParams`. Pass an application-defined object (DB handles, clients, state, etc.) to `PipelineTask(..., tool_resources=...)` and access it from any tool handler via `params.tool_resources`. Passed by reference; the caller retains their handle and can read mutations after the task finishes. Resolves #4256.