github / github/app

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

Ouverte
#330 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Bugs
Langage dominant
Aucune donnée de langage
Étoiles
2.1k
Forks
153
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.