Does onPostToolUse hook additionalContext get injected into sub-agent context?
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
- 35/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- javascript
- Lĩnh vực
- api, developer-experience
Hướng nghiên cứu
Bắt đầu với các điểm vào onPostToolUse hook, task tool và session.send({ mode: "immediate" }) bằng các phiên bản SDK được liệt kê. Tái hiện hành vi đồng thời kiểm tra nhật ký phiên để tìm các sự kiện hook.start và hook.end cũng như ngữ cảnh mà sub-agent nhận được. Được xem là hoàn tất khi phạm vi ngữ cảnh, hành vi phân phối tin nhắn và phương thức được khuyến nghị để điều hướng giữa lượt được ghi chép rõ ràng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Context
We're building a qa agent. It has an orchestrator agent that dispatches work to custom sub-agents via the task tool. We use session-level onPostToolUse hooks to enforce guardrails (retry limits on failing tests). The hooks fire correctly during sub-agent execution — we can see hook.start/hook.end events in the session journal, and onPreToolUse denials work as expected inside sub-agents.
What we observe
We have a guardrail that tracks test failures per spec. After 3 failures, we want to tell the sub-agent "stop retrying, mark as fixme, move on." Currently our hook calls session.send({ prompt: text, mode: "immediate" }) separately. The sub-agent ignores this and keeps retrying (7+ attempts observed).
Before max attempts, we return { additionalContext: feedbackText } from the hook (per-attempt guidance like "attempt 2/3, try a different approach"). We haven't been able to confirm whether this feedback actually reaches the sub-agent.
Questions
- Does
{ additionalContext }returned fromonPostToolUseget injected into the active sub-agent's context, or only the parent session? - Does
session.send({ mode: "immediate" })reach a running sub-agent, or does it queue on the parent session? - What is the recommended way to steer a sub-agent mid-turn from a hook?
Environment
@github/copilot-sdk@1.0.6@github/copilot@1.0.70- Custom agents with
tools: null(all tools) - Hooks registered at session creation via
hooks: { onPreToolUse, onPostToolUse }
- Ngôn ngữ chính
- Java
- Star
- 10.5k
- Fork
- 1.5k
- Merge trung bình
- 1 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 130
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của github/copilot-sdk
-
agentic-workflows
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
github/copilot-sdk#2760 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
github/copilot-sdk#2759 ·
-
documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
github/copilot-sdk#2758 ·
-
agentic-workflows
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
github/copilot-sdk#2709 · 1 bình luận ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
github/copilot-sdk#2673 ·
Tất cả issue của github/copilot-sdk
Issue tương tự
-
executions.Query — startDate and timeRange filters are sent with inverted comparison operators Đang mởarea/plugin
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
kestra-io/plugin-kestra#190 ·
-
litertlm-android AAR ships no consumer ProGuard rules → "mid == null" SIGABRT in minified apps Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
Add canonical URLs and a sitemap Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
apache/rocketmq-dashboard#5064 ·
-
Consent portal: creating a duplicate Purpose shows a generic error instead of "already exists" Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
wso2/dpdp-accelerator#287 ·