github / github/app

Background task completion notification is emitted while sub-agent is still running

オープン
#330 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
Bugs
主要言語
言語のデータがありません
スター
2.1k
フォーク
153
PR マージ指標
30日以内にマージされた PR はありません

説明

### Short summary

Main orchestration agents may receive Background task ... has completed notifications before the associated sub-agent has actually finished execution.

### Affected version or release

v0.2.7

### Installation context

Installed at organization scope. Issue observed in a private repository while using GitHub Copilot coding agent background task orchestration.

### What happened?

I have a main orchestration prompt that distributes work across multiple sub-agents.

The main agent:
- generates batches of work
- starts sub-agents to process those batches
- limits concurrent execution to 10 sub-agents
- monitors completion notifications to launch the next queued batches

The issue is that the main agent receives completion notifications such as:

```text
Background task 'taskname' (agent_id: agentname) has completed
```

Followed by:
```text
The agent is still running ar 122s with 14 tool calls completed. Let me think about what's happening...
```

Because of this false completion signal, the orchestrator assumes capacity has been freed and starts additional sub-agents prematurely.

As a result, the system eventually exceeds what appears to be the actual supported concurrent sub-agent limit (possibly 16), causing orchestration instability and inconsistent execution behavior.

```text
Write agent
Arguments
{...}
Cannot resume agent - all 16 concurrent agent slots are in use. Try again after an active agent completes.
```

### Steps to reproduce

1. Create a main orchestration prompt that processes work in batches.
2. Configure the orchestrator to:
- maintain a concurrency limit (example: 10)
- launch additional sub-agents when previous ones complete
3. Start enough batches to keep the queue active.
4. Observe that:
- completion notifications are emitted before sub-agents are actually finished
- the orchestrator launches additional sub-agents too early
- the total number of running sub-agents eventually exceeds the intended concurrency limit

### Expected behavior

A background task completion notification should only be emitted once the associated sub-agent execution has actually completed.

Alternatively, the API/event model should clearly distinguish between:
- parent task completion
- sub-agent lifecycle completion
- orchestration-level completion

### Additional context

_No response_

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

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

評価

この issue はまだ評価されていません。

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

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