feat: Expose the current hook point in Agent State

未关闭
#14,032 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
15/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
ai, backend

调研方向

The issue asks for Agent to expose the current hook point in State before hooks run, but it names no source files or tests. Read the Agent hook execution and State implementation to find where hook points are dispatched and how State values are exposed. Done means hooks can read the current point, such as before_llm or after_tool, and tests cover that behavior. This issue is marked for internal handling and is not open to external contributions.

由索引模型根据 Issue 内容生成。

描述

handled internally

Is your feature request related to a problem? Please describe.
A hook can't tell which hook point it is running at. A hook registered at several points has no way to change its behavior per point.

Example: PresidioPIIHook appended a system reminder after blocked messages. At after_tool, if the blocked result came from an exit-condition tool, the reminder became the Agent's last_message. The hook couldn't detect that it was running at after_tool, so it couldn't skip the reminder. We worked around it in deepset-ai/haystack-core-integrations#4360.

Describe the solution you'd like
Have the Agent write the current hook point (e.g. before_llm, after_tool) to State before running hooks, so a hook can read it if it needs to.

Additional context
Discussion: https://github.com/deepset-ai/haystack-core-integrations/pull/4360#issuecomment-7275496964


👋 Hello there! This issue will be handled internally and isn't open for external contributions. If you'd like to contribute, please take a look at issues labeled contributions welcome or good first issue. We'd really appreciate it!

主要语言
Python
星标
27.2k
派生
3.5k
平均合并
1 天 18 小时
30 天内合并 PR
254

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

deepset-ai/haystack 的其他 Issue

查看 deepset-ai/haystack 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。