Add per-sub-agent timeout / token budget / cancellation API
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 38/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- node.js, typescript
- 領域
- api
調査の方向性
issue に記載されている CustomAgentConfig および Session API から始め、既存の session.abort()、session.disconnect()、subagent.started/subagent.completed エントリーポイントを確認します。エージェントごとの予算、予算超過イベント、対象を指定したキャンセルがどのように動作すべきかを定義し、その後、セッションを切断せずに 1 つのサブエージェントを停止できることを検証します。
索引モデルが issue の本文から書いたものです。
説明
Summary
Consumers running multi-sub-agent sessions have no way to bound an individual sub-agent's execution time or cost. The only cancellation APIs are session-scoped (session.abort(), session.disconnect()), which kill the whole session including other concurrent sub-agents. A consumer with one runaway sub-agent has to choose between letting it burn cost/SLA or killing the whole session and losing the work of other agents.
Scenario
const session = await client.createSession({
customAgents: [
{ name: "researcher", description: "Codebase research", prompt: "..." }, // expected ~5 min
{ name: "fixer", description: "Apply fixes", prompt: "..." }, // expected ~15 min
],
});
await session.sendAndWait({ prompt: "Dispatch researcher then fixer." });
// On a complex codebase, researcher runs 90 minutes instead of 5.
// There's no way to kill JUST the researcher — only the whole session.
What's missing
CustomAgentConfig currently accepts {name, displayName?, description?, tools?, prompt, mcpServers?, infer?, skills?}. No maxTurnMs, maxTokens, maxToolCalls, or budget field.
Session class exposes session.abort() (cancels the current message, session remains valid — though see #1273 for in-flight sendAndWait still hanging) and session.disconnect() (kills the whole session). No session.agent("name").cancel() or session.cancelSubagent(toolCallId) equivalent.
Suggested API
- Per-agent budget options on
CustomAgentConfig:maxTurnMs,maxTokens,maxToolCalls. SDK/CLI enforces them and emitssubagent.budget_exceededevents when violated. - Per-sub-agent cancellation API:
session.cancelSubagent({ name?, toolCallId? })that kills a specific sub-agent without disconnecting the session.
Consumer impact
Production pipelines with cost or SLA requirements have to layer their own per-agent monitor watching subagent.started / subagent.completed events and tracking per-agent runtime. On overage they either log-and-tolerate (losing cost containment) or kill the whole session (losing work of other concurrent agents). Both choices are bad.
Production observation: a single misbehaving sub-agent (multi-tenant analysis worker) burned ~$150-200 in a single session before the surrounding watchdog hit the per-session ceiling. With a per-agent budget, the loss would have been ~$15.
Related
- #1273 —
session.disconnect()cooperative. Even when consumers detect runaway behavior and try to kill the session, the recovery path is broken. - #1275 —
sendAndWaitreturns prematurely. Without sub-agent completion tracking, consumers also can't reliably know which sub-agents are still running to budget them.
Environment
- SDK: @github/copilot-sdk@0.3.0
- CLI: @github/copilot@1.0.45
- Node: 22 LTS
- OS: Windows 11
- Model: claude-sonnet-4-6
- 主要言語
- Java
- スター
- 10.5k
- フォーク
- 1.5k
- 平均マージ
- 1日 9時間
- マージ済み PR(30日)
- 130
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
github/copilot-sdk のほかの issue
-
agentic-workflows
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
github/copilot-sdk#2760 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
github/copilot-sdk#2759 ·
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
github/copilot-sdk#2758 ·
-
agentic-workflows
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
github/copilot-sdk#2709 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
github/copilot-sdk#2673 ·
github/copilot-sdk の issue をすべて見る
似ている issue
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
apache/flink-agents#1152 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
jenkinsci/blueocean-plugin#5417 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
objectionary/eo-graphs#75 ·