feat: Expose the current hook point in Agent State

Đang mở
#14,032 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
15/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
ai, backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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!

Ngôn ngữ chính
Python
Star
27.2k
Fork
3.5k
Merge trung bình
1 ngày 18 giờ
Pull request đã merge (30 ngày)
254

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của deepset-ai/haystack

Tất cả issue của deepset-ai/haystack

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.