Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Does onPostToolUse hook additionalContext get injected into sub-agent context?

オープン
#1,971 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
ドキュメント
明瞭さ
説明が足りない
活発さ
静か
技術スタック
javascript

調査の方向性

記載されている SDK バージョンを使用し、onPostToolUse hook、task tool、session.send({ mode: "immediate" }) のエントリーポイントから始めます。動作を再現しながら、セッションジャーナルで hook.start と hook.end のイベント、およびサブエージェントが受け取ったコンテキストを確認します。コンテキストのスコープ、メッセージの配信動作、ターン途中でステアリングするための推奨方法が明確に文書化されていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

question

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

  1. Does { additionalContext } returned from onPostToolUse get injected into the active sub-agent's context, or only the parent session?
  2. Does session.send({ mode: "immediate" }) reach a running sub-agent, or does it queue on the parent session?
  3. 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 }
主要言語
Java
スター
10.5k
フォーク
1.5k
平均マージ
1日 9時間
マージ済み PR(30日)
130

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

github/copilot-sdk のほかの issue

github/copilot-sdk の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。