github / github/app

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

Abierto
#330 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Bugs
Lenguaje dominante
Sin datos de lenguaje
Estrellas
2.1k
Forks
153
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.