eino icon indicating copy to clipboard operation
eino copied to clipboard

通过 BeforeAgent 钩子修改了 runCtx.Tools 时,丢失了 UnknownToolsHandler 等字段

Open Slideee opened this issue 7 months ago • 3 comments

Describe the bug 配置了UnknownToolsHandler不生效。发现当中间件通过 BeforeAgent 钩子修改了 runCtx.Tools 时,框架会创建一个新的 execContext,但只复制了 Tools 和 ToolCallMiddlewares,丢失了 UnknownToolsHandler。后续重建 ToolsNode 时,handler 就变成了 nil,导致直接报错而不是走UnknownToolsHandler配置的兜底逻辑。

Image

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Version:

Please provide the version of {project_name} you are using.

Environment:

The output of go env.

Additional context

Add any other context about the problem here.

Slideee avatar Apr 14 '26 08:04 Slideee

升级到 eino v0.8.9

shentongmartin avatar Apr 14 '26 09:04 shentongmartin

非常抱歉,但是我最近又一次遇到了相似的问题,并且我在项目中所使用的就是 eino v0.8.9 版本,同样在以配置好 UnknownToolsHandler 字段后,当我的模型想要使用未被提供的工具时,仍然没有运行该处理函数,而导致我的程序无法正常运行。 我已经尝试了我能想到的所有方法来解决这个问题,但不足以达到我的预期。我想知道在 v0.8.9 版本中是否真的解决了该问题,或者在eino框架中实现了与之类似功能的方法。若真的已经解决,是否是我对某些内容未进行相应的配置。

pykelysia avatar Apr 24 '26 14:04 pykelysia

需要升级到 v0.9.0-alpha.x 版本

shentongmartin avatar Apr 27 '26 01:04 shentongmartin