Skip to content

Tool call parameters are decoded in the wrong context #697

Description

@eb8680

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

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions