github / github/app

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

Đang mở
#330 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Bugs
Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
2.1k
Fork
153
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### 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_

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

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.