In the current handlers.llm.call_assistant, we decode tool calls in a context containing only Tools. However, for parameter types like Callable which have context-sensitive decoders, we should be decoding in a context that includes the full lexical environment as well as any Tools injected via handling collect_tools, provided they don't collide with lexical variables.
This bug is particularly salient in the context of #693, which relies crucially on a Tool that takes a Callable argument. There's a simple fix included #694 that we may want to test more robustly and land sooner as a separate PR prior to #693
In the current
handlers.llm.call_assistant, we decode tool calls in a context containing onlyTools. However, for parameter types likeCallablewhich have context-sensitive decoders, we should be decoding in a context that includes the full lexical environment as well as anyTools injected via handlingcollect_tools, provided they don't collide with lexical variables.This bug is particularly salient in the context of #693, which relies crucially on a
Toolthat takes aCallableargument. There's a simple fix included #694 that we may want to test more robustly and land sooner as a separate PR prior to #693